/* @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 && (
  1. hello
  2. world
)}

Code:

{codeString}
); } toggleMenu = (event: KeyboardEvent) => { event.preventDefault(); this.setState({ showMenu: !this.state.showMenu }); }; } const codeString = ` `;