useInRouterContext
react-router

useInRouterContext

useInRouterContext(): boolean

Returns true if this component is a descendant of a Router, useful to ensure a component is used within a Router.

Docs and examples CC 4.0