React/Material-UIでdrawer
4534 ワード
MyDrawer.js
import React, { useState } from "react";
import { Button, Drawer, List, ListItem } from "@material-ui/core";
const MyDrawer = () => {
const [state, setstate] = useState(false);
const flag = () => {
setstate(!state);
console.log(state);
};
return (
<div>
<Button variant="contained" color="primary" onClick={flag}>
Open Drawer
</Button>
<Drawer open={state} onClose={flag}>
<List>
<ListItem>AAA</ListItem>
<ListItem>BBB</ListItem>
<ListItem>CCC</ListItem>
</List>
</Drawer>
</div>
);
};
export default MyDrawer;
Author And Source
この問題について(React/Material-UIでdrawer), 我々は、より多くの情報をここで見つけました https://qiita.com/yono2844/items/0d29f2912f38cf9200ad著者帰属:元の著者の情報は、元の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 .