mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
12 lines
290 B
TypeScript
12 lines
290 B
TypeScript
import {useContext} from 'react';
|
|
|
|
import {RouteContext} from 'sentry/views/routeContext';
|
|
|
|
export function useRouteContext() {
|
|
const route = useContext(RouteContext);
|
|
if (route === null) {
|
|
throw new Error(`useRouteContext called outside of routes provider`);
|
|
}
|
|
return route;
|
|
}
|