---
title: useInRouterContext
---

# useInRouterContext

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.useInRouterContext.html)

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

## Signature

```tsx
useInRouterContext(): boolean
```
