import * as React from 'react'; import { Item } from 'rc-menu'; import PropTypes from 'prop-types'; import Tooltip from '../tooltip'; class MenuItem extends React.Component { static contextTypes = { inlineCollapsed: PropTypes.bool, }; static isMenuItem = 1; private menuItem: any; onKeyDown = (e: React.MouseEvent) => { this.menuItem.onKeyDown(e); } saveMenuItem = (menuItem: any) => { this.menuItem = menuItem; } render() { const { inlineCollapsed } = this.context; const props = this.props; const item = ; if (inlineCollapsed && props.level === 1) { return {item} ; } return item; } } export default MenuItem;