diff --git a/src/content/reference/react-dom/hooks/useFormStatus.md b/src/content/reference/react-dom/hooks/useFormStatus.md index ec63ed31f62..abaa9b6f2b2 100644 --- a/src/content/reference/react-dom/hooks/useFormStatus.md +++ b/src/content/reference/react-dom/hooks/useFormStatus.md @@ -29,7 +29,8 @@ const { pending, data, method, action } = useFormStatus(); The `useFormStatus` Hook provides status information of the last form submission. -```js {4},[[1, 5, "status.pending"]] +```js {5},[[1, 6, "status.pending"]] +import { useFormStatus } from "react-dom"; import action from './actions'; function Submit() { @@ -257,4 +258,4 @@ export async function submitForm(query) { If the component that calls `useFormStatus` is not nested in a `
`, `status.pending` will always return `false`. Verify `useFormStatus` is called in a component that is a child of a `` element. -`useFormStatus` will not track the status of a `` rendered in the same component. See [Pitfall](#useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component) for more details. \ No newline at end of file +`useFormStatus` will not track the status of a `` rendered in the same component. See [Pitfall](#useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component) for more details.