MCPcopy Create free account
hub / github.com/editablejs/editable / useActiveSection

Function useActiveSection

apps/docs/src/hooks/usePathWithoutQuerystring.ts:3–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { useRouter } from 'next/router'
2
3export function useActiveSection(): 'learn' | 'apis' | 'home' {
4 const { asPath } = useRouter()
5 if (asPath.startsWith('/learn')) {
6 return 'learn'
7 } else if (asPath.startsWith('/apis')) {
8 return 'apis'
9 } else {
10 return 'home'
11 }
12}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…