March 2019
Intermediate to advanced
534 pages
14h 52m
English
Let's start by looking at the state of your component:
const [open, setOpen] = useState(false);const [content, setContent] = useState('Home');const [items] = useState([ { label: 'Home', Icon: HomeIcon }, { label: 'Page 2', Icon: WebIcon }, { label: 'Page 3', Icon: WebIcon, disabled: true }, { label: 'Page 4', Icon: WebIcon }, { label: 'Page 5', Icon: WebIcon, hidden: true }]);
The open state controls the visibility of the Drawer component, and the content state is the text that's displayed on the screen depending on which drawer item is clicked on. The items state is an array of objects that is used to render the drawer items. Every object has a label property and an Icon property that are used to render the item text and ...
Read now
Unlock full access