TanStackT
TanStack5mo ago
7 replies
slow-yellow

How do I redirect a user after successfully submitting a form?

I'm currently using the set up exactly as outlined in the Next.js integration docs, and using redirect from next/navigation inside the Server Action. However, when submitting, I see some odd behavior where the validations run once more after my server action, and then I see some errors briefly on the form before it finally redirects.

Is there a canonical way to redirect? (I searched the docs and the Discord for "redirect" and found nothing)
Was this page helpful?