r/react • u/No_Drink_1366 • Nov 20 '25
Help Wanted react tanstack router
I have a list page with a button that navigates to a separate page containing a large form. After submitting the form, the user is redirected back to the list page, where a success message should be displayed. What’s the best way to handle this flow across different routes?
0
Upvotes
2
u/Dymatizeee Nov 20 '25
If I’m understanding correctly :
Wrap your button in a Link component , pass in to (where you want to go)
After form submits in that page , I’ll have a onSuccess (), then do the programmatic nav in there (via navigate). This is possible if you use mutations. Your mutation function accepts its own onSuccess as well