Replies: 2 comments 1 reply
-
Same question for e.g. after loading some async data I want to navigate to a certain route, depending on the data that came in. (probably the same answer anyway?) |
Beta Was this translation helpful? Give feedback.
-
Yeah.. I mean it can't read from Context outside. But once it has the reference you are good to go. So I'd grab them inside a child of There is a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to find out the router location outside of a component?
Just calling it gives
Make sure your app is wrapped in a <Router />
I understand the router is not global, so I need to keep track of my router somehow and provide a context before calling
useLocation
, but I've no idea yet how to do that.In case it sounds like an odd thing to need to do, it's for a debug helper I'd like to be able to call from the console.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions