/* @flow */ import React from 'react'; import SyntaxHighlighter from 'react-syntax-highlighter/prism'; import { light } from 'react-syntax-highlighter/styles/prism'; import ExampleBox from '../ExampleBox'; import KeyHandler, { KEYPRESS } from '../../../../lib'; type State = { showMenu: boolean, }; export default class Component extends React.Component<{||}, State> { state: State = { showMenu: false }; render() { const { showMenu } = this.state; return ( Component example: Press s to toggle the menu. {showMenu && ( hello world )} Code: {codeString} ); } toggleMenu = (event: KeyboardEvent) => { event.preventDefault(); this.setState({ showMenu: !this.state.showMenu }); }; } const codeString = ` `;
Press s to toggle the menu.
s