import * as React from 'react'; import { Menu, SubmenuItem, MenuItem } from '../menu'; import ContextMenu from './ContextMenu'; class ContextMenuWithSubmenuExample extends React.Component { state = { rightBoundaryElement: undefined, bottomBoundaryElement: undefined, }; render() { return (
{ if (!this.state.rightBoundaryElement) { this.setState({ rightBoundaryElement: ref, }); } }} className="context-menu-example-target" style={{ height: 200, }} > Target Component - right click me
) => { if (!this.state.bottomBoundaryElement) { this.setState({ bottomBoundaryElement: ref, }); } }} > View Profile View Profile {this.state.rightBoundaryElement && ( Submenu View Profile View Profile View Profile )} Help
); } } export default ContextMenuWithSubmenuExample;