import React, { FC, useContext } from 'react'; import { NavigationContext } from './context'; import { Section, Item, ItemProps } from './components'; import { ConfigContext } from '../config-provider'; export interface NavigationProps { title?: React.ReactNode; location: string; children?: React.ReactNode; onDismiss?(): void; menuItemRender?: ( originalProps: { className: string; onClick: (event: React.MouseEvent) => void; }, itemProps: ItemProps, defaultDom: React.ReactNode, ) => React.ReactNode; } const Navigation: FC & { Item: typeof Item; Section: typeof Section; } = function Navigation({ children, title, location, menuItemRender }: NavigationProps) { const { getPrefixCls } = useContext(ConfigContext); const prefixCls = getPrefixCls('navigation'); const context = { location, menuItemRender }; return ( ); }; Navigation.Item = Item; Navigation.Section = Section; export default Navigation;