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>;
}

Explanation

It must be called from a component rendered inside the <form>, not in the component that renders the form itself.

Further reading

Problem with a question

React · Middle · question 68

Test yourself

Take the React · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz