Often parent routes manage state or other values you want shared with child
routes. You can create your own context provider
if you like, but this is such a common situation that it's built-into
<Outlet>.
If you're using TypeScript, we recommend the parent component provide a
custom hook for accessing the context value. This makes it easier for
consumers to get nice typings, control consumers, and know who's consuming
the context value.
Returns the parent route
<Outlet context>.Often parent routes manage state or other values you want shared with child routes. You can create your own context provider if you like, but this is such a common situation that it's built-into
<Outlet>.If you're using TypeScript, we recommend the parent component provide a custom hook for accessing the context value. This makes it easier for consumers to get nice typings, control consumers, and know who's consuming the context value.
Here's a more realistic example: