Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getOpenKeys={({ menus, lastPath }) => {
const keyMap = mapNestedPath(menus);
return menus
.filter(({ key }) => keyMap[key].includes(lastPath))
.map(({ key }) => key);
}}
>
const keyMap = React.useMemo(() => mapNestedPath(menus), [menus]);
const [iSelectedKey, setSelectedKey] = useStateBinding(selectedKey, '');
getOpenKeys: ({ menus, lastPath }) => {
const keyMap = mapNestedPath(menus);
return menus
.filter(({ key }) => keyMap[key].includes(lastPath))
.map(({ key }) => key);
},
};
const keyMap = useMemo(() => mapNestedPath(menus), [menus]);
const {