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

Function updateSelection

packages/dev/s2-docs/pages/s2/RoutedSideNav.tsx:12–14  ·  view source on GitHub ↗
(href: string)

Source from the content-addressed store, hash-verified

10 let [selectedRoute, setSelectedRoute] = useState<string>(props.defaultSelectedRoute);
11
12 let updateSelection = (href: string) => {
13 setSelectedRoute(href);
14 };
15
16 return <RouterProvider navigate={updateSelection}>{children({selectedRoute})}</RouterProvider>;
17}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected