Next.js · Middle · Question 41 of 75

Why is useFormStatus handy in forms with Server Actions?

Explanation

The hook is called in a component inside <form> (usually the submit button): const { pending } = useFormStatus(). This lets you build a reusable <SubmitButton>. The action's result and errors are held by useActionState.

Further reading

Problem with a question

Next.js · Middle · question 41

Test yourself

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

Take this quiz