useOutletContext

Returns the context (if provided) for the child route at this level of the route hierarchy.

See also

https

://reactrouter.com/v6/hooks/use-outlet-context