-
I assumed that in nested routes, the outlet will be passed on to all the deep nested routes. But as soon as I introduce another nested level, the content from the parent route is not passed on to the child route. This is required if I want to use some kind of navbar. Is there any way this can be achieved? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
First, why this happens, each Outlet renders a new Provider for the context it uses internally, and because there's no way to automatically know how to merge your Outlet data React Router (because this comes from RR not from Remix) can't automatically extend the data. Now, a few ideas:
|
Beta Was this translation helpful? Give feedback.
-
I was looking at the wrong documentation. I got it working by defining the common layout file with the "__" prefix. |
Beta Was this translation helpful? Give feedback.
First, why this happens, each Outlet renders a new Provider for the context it uses internally, and because there's no way to automatically know how to merge your Outlet data React Router (because this comes from RR not from Remix) can't automatically extend the data.
Now, a few ideas: