useInRouterContext

Returns true if this component is a descendant of a <Router>.

See also

https

://reactrouter.com/v6/hooks/use-in-router-context