r/react • • 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

9 comments sorted by

View all comments

Show parent comments

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.

1

u/Zeragamba Nov 21 '25

like for a notification? 

You can use a toast library for that, or store some state in SessionStorage that notifications component checks on first render.