Skip to content

Commit 9d5629b

Browse files
committed
update on onSubmit vs action prop note
1 parent 7ad9c1d commit 9d5629b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/content/reference/react-dom/components

‎src/content/reference/react-dom/components/form.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default function Search() {
8686

8787
<Note>
8888

89-
Reading form data with `onSubmit` works in every version of React and gives you direct access to the [submit event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event). Prefer the [`action` prop](#handle-form-submission-with-an-action-prop) when you want Transitions, pending state, Error Boundaries, or [Server Functions](/reference/rsc/server-functions).
89+
`onSubmit` works in every version of React and gives you direct access to the [submit event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event). Starting in React 19, the [`action` prop](#handle-form-submission-with-an-action-prop) is the preferred API for form submissions, because React handles the submission in a [Transition](/reference/react/useTransition), with pending state, optimistic updates, handles concurrency across multiple submissions, Error Boundaries, and [Server Functions](/reference/rsc/server-functions).
9090

9191
</Note>
9292

0 commit comments

Comments
 (0)