useOutletContext

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

See also

https

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