MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getPageFromPathname

Function getPageFromPathname

packages/dev/s2-docs/src/Router.tsx:49–55  ·  view source on GitHub ↗
(pages: Page[], url: string | null)

Source from the content-addressed store, hash-verified

47}
48
49export function getPageFromPathname(pages: Page[], url: string | null): Page | null {
50 if (!url) {
51 return null;
52 }
53
54 return pages.find(p => p.url === url) ?? null;
55}
56
57function useDelayedSnapshot() {
58 let [delayedSnapshot, setDelayedSnapshot] = useState(getSnapshot());

Callers 2

RouterFunction · 0.85
usePendingPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected