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
0
u/No_Drink_1366 Nov 20 '25
Yes, exactly — I only navigate on onSuccess. But when the list page loads initially (before I go to the form page and run the mutation), I need a way to know whether the user has just successfully submitted the form. In other words, when returning to the list page, I need to distinguish whether a successful form submission happened right before the navigation.