Skip to content

Instantly share code, notes, and snippets.

@bautistaaa
Created May 4, 2020 17:00
Show Gist options
  • Save bautistaaa/5871f08c2cfb0ebd3ad34622de2d57d0 to your computer and use it in GitHub Desktop.
Save bautistaaa/5871f08c2cfb0ebd3ad34622de2d57d0 to your computer and use it in GitHub Desktop.
{selectedMenus[depth] === label && (
<SidebarItem.List depth={depth}>
{children.map((child, i) => {
const { label } = child;
const childDepth = depth + 1;
return (
<SidebarItem
link={child}
handleMenuSelection={handleMenuSelection}
key={`child-${label}-${i}`}
depth={childDepth}
selectedMenus={selectedMenus}
/>
);
})}
</SidebarItem.List>
)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment