main
Branches
main (6.4.1)dev
Versions
6.4.1v4/5.xv3.x
useInRouterContext

useInRouterContext

Type declaration
declare function useInRouterContext(): boolean;

The useInRouterContext hooks returns true if the component is being rendered in the context of a <Router>, false otherwise. This can be useful for some 3rd-party extensions that need to know if they are being rendered in the context of a React Router app.

Docs and examples CC 4.0
Edit