import React, { ReactElement, ReactNode } from "react"; import { MenuContext } from "./MenuContext"; import SubNavigation from "./SubNavigation"; import NavLink from "./NavLink"; type Props = { to: string; icon: string; label: string; title: string; activeWhenMatch?: (route: any) => boolean; activeOnlyWhenExact?: boolean; children?: ReactElement[]; }; export default class SecondaryNavigation extends React.Component { render() { const { to, icon, label, title, activeWhenMatch, activeOnlyWhenExact, children } = this.props; if (children) { return ( {({ menuCollapsed }) => ( {children} )} ); } else { return ( {({ menuCollapsed }) => } ); } } }