Passing an async function to "action" vs "onSubmit"
Answered
Florian posted this in #help-forum
FlorianOP
Is there any difference between passing an async function to a forms
action prop vs onSubmit other than the fact that I get FormData and don't have to call e.preventDefault?Answered by joulev
What you did is called a client action and it has a few benefits: https://x.com/reactjs/status/1716573569193476467?s=46
2 Replies
@Florian Is there any difference between passing an async function to a forms `action` prop vs `onSubmit` other than the fact that I get `FormData` and don't have to call `e.preventDefault`?
What you did is called a client action and it has a few benefits: https://x.com/reactjs/status/1716573569193476467?s=46
Answer
FlorianOP
very interesting, thank you