You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How could I collapse the navigation bar on purpose? I want it to collapse after each selection, i.e. if you choose Home the sidebar should minimize right away.
I tried the following:
onSelect={(selected) => {
const to = '/' + selected;
if (location.pathname !== to) {
history.push(to);
}
this.setState({ expanded: false });
But it does not work yet.
The text was updated successfully, but these errors were encountered:
From what I can tell, the state inside the sidebar gets updated on click of the toggle; but does not update on componentDidUpdate from props changing. It would be great if that were added. You can achieve what you are looking for by putting app.js inside of your router so that whenever a new url is pushed to props.history the whole page re-renders which clears the state of the sidebar. Not the best solution but this could achieve what you are looking to do.
How could I collapse the navigation bar on purpose? I want it to collapse after each selection, i.e. if you choose
Home
the sidebar should minimize right away.I tried the following:
But it does not work yet.
The text was updated successfully, but these errors were encountered: