router icon indicating copy to clipboard operation
router copied to clipboard

Parent route components rerender when child routes change

Open mer10z opened this issue 3 years ago • 1 comments

Describe the bug

With nested routes, when navigating between child routes within the same parent, or navigating between the same child route with different search params, all of the ancestor route components in the route hierarchy rerender.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-ayc4dj?file=src/main.tsx

Steps to Reproduce the Bug or Issue

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.

Expected behavior

Parent route components should not remount when child routes change

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 109.0.5414.119

Additional context

"@tanstack/react-router": "0.0.1-beta.80"

mer10z avatar Feb 09 '23 17:02 mer10z

This is no longer the case in the latest version.

tannerlinsley avatar Jul 07 '23 17:07 tannerlinsley