State Management · Middle · Question 48 of 75

How do you redirect from an action after creating an item?

Explanation

Loaders and actions run outside components, so hooks aren't available. redirect creates a response the router follows. Hooks like useNavigate work only in components.

Further reading

Problem with a question

State Management · Middle · question 48

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