main
Branches
main (6.22.3)dev
Versions
6.22.3v4/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