useSideNavigation
is a React hook for managing SideNavigation
's state with
React Router.
SideNavigation
's activeHref
prop
SideNavigation
's onFollow
prop
import SideNavigation from '@awsui/components-react/side-navigation';
import { useSideNavigation } from 'use-next-awsui';
const ITEMS = [
// ...
];
export default function MySideNavigation() {
const { activeHref, handleFollow } = useSideNavigation();
return (
<SideNavigation
activeHref={activeHref}
items={ITEMS}
onFollow={handleFollow}
/>
);
}