State Management · Middle · Question 46 of 75

How do you show a pending state during navigation or form submission in React Router?

Explanation

navigation.state !== 'idle' means the router is loading a page or submitting a form, and navigation.formData holds the submitted data - enough for spinners and disabled buttons.

Further reading

Problem with a question

State Management · Middle · question 46

Test yourself

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

Take this quiz