You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in my company we are using tanstack/router with single-spa framework. We migrated from react-router and when navigating between MFs using single-spa navigation we spotted issue where route.useParams would return old route param ID when beforeLoad and loader would return current ID present in URL. Only after some 300-500ms route.useParams would catch up and after that in app navigation with tanstack router methods would work flawless.
After investigation I found out that recreating client on single-spa mount lifecycle resolved issue. I tried .clearCache method on unmount, but it doesn't affect this issue. Basically router client was staying in memory and with some state that after navigating into MF would cause delayed sync.
Has anyone encountered similar issue? Why beforeLoad is instant reading from URL where useParams is reading from some context and is out of sync?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
in my company we are using tanstack/router with single-spa framework. We migrated from react-router and when navigating between MFs using single-spa navigation we spotted issue where
route.useParams
would return old route param ID whenbeforeLoad
andloader
would return current ID present in URL. Only after some 300-500msroute.useParams
would catch up and after that in app navigation with tanstack router methods would work flawless.After investigation I found out that recreating client on single-spa mount lifecycle resolved issue. I tried
.clearCache
method on unmount, but it doesn't affect this issue. Basically router client was staying in memory and with some state that after navigating into MF would cause delayed sync.Has anyone encountered similar issue? Why beforeLoad is instant reading from URL where useParams is reading from some context and is out of sync?
Beta Was this translation helpful? Give feedback.
All reactions