React · Middle · Question 68 of 75
How does useFormStatus help in a React 19 form?
function SubmitButton() {
const { pending } = useFormStatus();
return <button disabled={pending}>Save</button>;
}- ✓Correct answer: A component inside a
<form>can read whether the form's action is pending without prop drilling - 2It validates form fields
- 3It submits the form automatically
Explanation
It must be called from a component rendered inside the <form>, not in the component that renders the form itself.