Skip to content

Commit f2ce773

Browse files
committed
docs: cross-link automatic and manual form resets
1 parent a91362b commit f2ce773

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Reading form data with `onSubmit` works in every version of React and gives you
8888

8989
### Handle form submission with an action prop {/*handle-form-submission-with-an-action-prop*/}
9090

91-
Pass a function to the `action` prop of form to run the function when the form is submitted. [`formData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) will be passed to the function as an argument so you can access the data submitted by the form. This differs from the conventional [HTML action](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#action), which only accepts URLs. Unlike `onSubmit`, an `action` runs in a [Transition](/reference/react/useTransition) and calling `e.preventDefault()` isn't needed. After the `action` function succeeds, all uncontrolled field elements in the form are reset.
91+
Pass a function to the `action` prop of form to run the function when the form is submitted. [`formData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) will be passed to the function as an argument so you can access the data submitted by the form. This differs from the conventional [HTML action](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#action), which only accepts URLs. Unlike `onSubmit`, an `action` runs in a [Transition](/reference/react/useTransition) and calling `e.preventDefault()` isn't needed. After the `action` function succeeds, all uncontrolled field elements in the form are reset. If you handle submission manually, you can [request the same reset behavior with `requestFormReset`](/reference/react-dom/requestFormReset#requesting-a-reset-in-a-custom-form-action).
9292

9393
<Sandpack>
9494

‎src/content/reference/react-dom/requestFormReset.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function handleSubmit(form) {
5858

5959
### Requesting a reset in a custom form Action {/*requesting-a-reset-in-a-custom-form-action*/}
6060

61-
React automatically resets uncontrolled fields after a successful `<form action={...}>` submission. When you implement submission manually, you can opt into the same behavior by calling `requestFormReset`.
61+
React [automatically resets uncontrolled fields after a successful `<form action={...}>` submission](/reference/react-dom/components/form#handle-form-submission-with-an-action-prop). When you implement submission manually, you can opt into the same behavior by calling `requestFormReset`.
6262

6363
```js
6464
import { startTransition } from 'react';

0 commit comments

Comments
 (0)