mui-nav-menu
Version:
Navigation menu component based on material ui
8 lines (7 loc) • 323 B
JavaScript
import { createContext, useContext, useMemo } from "react";
const PathContext = createContext([]);
export function useConnectedPath(id) {
const parentIdPath = useContext(PathContext);
return useMemo(() => (id !== undefined ? [...parentIdPath, id] : parentIdPath), [parentIdPath, id]);
}
export default PathContext;