Next.js · Middle · Question 56 of 75
What does redirect() in a Server Action do for a form submitted before JavaScript loaded?
- ✓Correct answer: It responds with a 303 redirect, so the browser follows it with a GET
- 2It does nothing until hydration
- 3It returns a 500 error
Explanation
When JavaScript is available, redirect performs a client-side navigation. The 303 status keeps progressive enhancement working without re-posting the form.