Skip to content
Discussion options

You must be logged in to vote

I think this might be related to #7921. That issue hits an invalid hook call rather than the duplicated layout here, but the underlying HMR behavior looks pretty similar.

The Vite HMR code checks window.TSR_ROUTER even during the initial route-module import in dev. So if the inner root is loaded while that global points to the outer router, it can end up updating the wrong route. That could also explain why the outer header shows up again in the inner router in your screenshot.

#7937 was superseded by #8277, which is still open and changes this area so route updates stay associated with the router that owns the route.

I wouldn't use window.TSR_ROUTER = undefined as a permanent workaround …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@piatrashkakanstantinas
Comment options

Answer selected by piatrashkakanstantinas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants