Replies: 1 comment
-
|
can you provide a minimal complete example on stackblitz that shows the performance issue here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I’ve hit some subtle performance problems while migrating from React Router to TanStack Router that come from the requirement that each route specifies a component.
When multiple routes render structurally similar React trees, React sees a different component type at the route boundary and recreates the entires tree underneath it.
The workaround I’ve ended up doing is child matching in the parent route:
This can be made to work, but the parent is now implementing part of the router’s matching logic and it gets messy with complex route trees.
React Router avoids this issue by allowing routes to specify elements rather than only components:
Would TanStack Router consider similarly supporting an
elementroute option alongsidecomponent?Beta Was this translation helpful? Give feedback.
All reactions