I have some issues in my ReactJS project. I was using a hamburger menu in my site's corner and I was using to point to the other pages. The issue is that I had to change from <li><a href="/LoginPage">Login Page</a></li>
to <li><Link to="/LoginPage">Login Page</Link></li>
and then my Hamburger tab does not close itself after I press on some certain page. I was using state and some javascript code for it. Now since it didn't work I tried some changes in my JSX file: <Link to={{pathname: "/LoginPage", state: closeSideDrawer}}>Login Page</Link>
and I had this code as well
render() {
this.state = {
user: null,
sideDrawerOpen: false
};
let closeSideDrawer = () => {
this.setState((prevState) => {
return {sideDrawerOpen: prevState.sideDrawerOpen};
});
}
}