Parent route components unmounting and remounting when child routes change
Are parent route components expected to remount when navigating between two child routes or even the same child route with different search params? I have a situation where I have some memoization in a parent route component but because it's getting remounted when child routes change it's not working. I have a stack blitz demonstrator here: https://stackblitz.com/edit/tanstack-router-ayc4dj?file=src/main.tsx. Within the "Home" page I have two links that go the active route with different searches and if you look at the console logs you can see that every level of the route hierarchy is getting remounted. Is there some way to configure the links or the routes to prevent everything from remounting? Thanks.
1 Reply
foreign-sapphire•3y ago
This is a bug. Please file a GitHub issue 🙂