MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / useActiveRoute

Function useActiveRoute

src/hooks/useActiveRoute.js:4–8  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { ActiveRouteContext } from '../components/context/ActiveRouteContext/ActiveRouteContext';
3
4export const useActiveRoute = () => {
5 const ctx = useContext(ActiveRouteContext);
6 if (!ctx) throw new Error('useActiveRoute must be used within an ActiveRouteProvider');
7 return ctx;
8};

Callers 1

CliInstallationFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected