I want to add a side menu bar in my react application . Initially it should be closed only icons should be visible and on clicking on one icon entire sidemenu should menu..I am doing this way But it is not closing and is not closing.. I tried out different ways but not able to achieve it
In parent component:
const [show, setShow] = React.useState(false)
return <div>{show ? <SideMenu /> : <Icon />}</div>
If I understood an issue properly.
And use onClick in Icon to change show state.