React/Material-UIでappbar+drawer
5531 ワード
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;
Author And Source
この問題について(React/Material-UIでappbar+drawer), 我々は、より多くの情報をここで見つけました https://qiita.com/yono2844/items/8d78ffa6cef6538162b7著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .