T
TanStack17mo ago
wise-white

Update Parent Route From Child Route After Mutation

How do I get the parent routes loader to refire after a mutation on my child route? I would like to do this from within my child route if possible. My parent route contains a list that the child route can update so I need to refresh it once I've submitted the form successfully.
1 Reply
wise-white
wise-whiteOP17mo ago
Using react query and setting my defaultPreloadStaleTime to 0 on my router object did the trick. After my mutation fired I invalidated the query and this went and fetched a new version of the data after my mutation was finished.

Did you find this page helpful?