This website collects cookies to deliver better user experience
Taking advantage of react-router v6 to manage Providers
Taking advantage of react-router v6 to manage Providers
All of us know how tricky may react architecture be. One of the best approach that I bumped into during my react developer career was to move files around until it feels right
and today I'd love to share my approach to setup <AppProviders /> with React Router v6
React Router provides us with powerful tool which is nested routes. Right now we may create routes in the following fashion:
and if our <AppProviders /> contains <Outlet/> inside, it will also render content of our subroute, in this case <Home />, as it is index ('/') of our precedent route.
So what we want to do is create our <AppProviders /> right now: