Prevent same component from unmounting between routes
I have these three routes:
*
*
*
All of these routes render my
Is it possible for the component to stay mounted in between route changes, if the component each route renders is the same but the props differ?
*
/search/*
/search/$query*
/search/$query/$sectionAll of these routes render my
<SearchIndex /> component with a query and section props if those params are available. In our react-router@v3 setup the component stays mounted between routes if both routes render the same component, but I notice that TanStack Router re-mounts the component each time the matched route changes, which is causing weird state issues and preventing us from doing the transitions we want.Is it possible for the component to stay mounted in between route changes, if the component each route renders is the same but the props differ?