React/Material-UIでappbar+drawer


MyDashboard.js
import React, { useState } from "react";
import {
  AppBar,
  Drawer,
  IconButton,
  List,
  ListItem,
  Toolbar,
  Typography,
} from "@material-ui/core";
import MenuIcon from "@material-ui/icons/Menu";

const MyDashboard = () => {
  const [state, setstate] = useState(false);
  const handleClick = () => {
    setstate(!state);
  };
  console.log(state);

  return (
    <div>
      <AppBar position="static">
        <Toolbar>
          <IconButton onClick={handleClick}>
            <MenuIcon />
          </IconButton>
          <Typography>My Dashboard</Typography>
        </Toolbar>
      </AppBar>
      <Drawer open={state} onClose={handleClick}>
        <List>
          <ListItem>AAAAA</ListItem>
          <ListItem>BBBBB</ListItem>
          <ListItem>CCCCC</ListItem>
        </List>
      </Drawer>
    </div>
  );
};

export default MyDashboard;