Type Declaration
Props
Provides a context value to the element tree below the outlet. Use when the parent route needs to provide values to child routes.Access the context with
useOutletContext:Examples
Basic Layout
Passing Context
Nested Outlets
Conditional Outlet
Behavior
- Returns
nullif there is no child route that matches - Renders the element of the child route that matches the current location
- Can be used multiple times in nested route hierarchies
- Context is type-safe when used with TypeScript and proper typing
Related Hooks
useOutlet- Returns the outlet elementuseOutletContext- Access context passed to the outlet