Replies: 1 comment
-
@arn4v Try router.state & router.navigate |
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.
-
Why doesn't React Router allow accessing
NavigateFunction
, params, and location objects globally?In many instances, router state needs to be accessed/mutated outside of React but since router state/navigate function is only accessible through hooks it leads to this weird prop/argument drilling of navigate/location/params to non-React functions.
Why can't location, params and navigate be accessed through the router object returned by
createBrowserRouter
?Beta Was this translation helpful? Give feedback.
All reactions