File tree Expand file tree Collapse file tree
src/content/reference/react-dom/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -472,7 +472,6 @@ export default function ArticleForm() {
472472 const content = payload .data .get (' content' );
473473 switch (payload .type ) {
474474 case ' save' :
475-
476475 alert (` Your draft of '${ content} ' was saved!` );
477476 // Keep the submitted content as the current draft
478477 return payload .data ;
@@ -481,23 +480,22 @@ export default function ArticleForm() {
481480 // reset the form
482481 return new FormData ();
483482 }
484- });
483+ }, new FormData () );
485484
486485 function publish (formData ) {
487486 dispatchFormState ({
488487 type: ' publish' ,
489488 data: formData
490- })
489+ });
491490 }
492491
493492 function save (formData ) {
494493 dispatchFormState ({
495494 type: ' save' ,
496495 data: formData
497- })
496+ });
498497 }
499498
500- // const savedContent = draft.get('content') || '';
501499 return (
502500 < form action= {publish}>
503501 < textarea
You can’t perform that action at this time.
0 commit comments