Router Context vs React Context - What's the best practice. #5885
devinvillarosa
started this conversation in
General
Replies: 0 comments
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.
-
Say I have a new file route, and my entire route component is wrapped with a React Context.
And throughout the different children routes, I'm accessing my React Context with my own
useRouteContext()hooks.Is it better practice to remove the React Context, and store the info in the parent's route context instead in the
beforeLoadfunction? And then access the context in my children routes withRoute.useRouteContext()Beta Was this translation helpful? Give feedback.
All reactions