Answer the question
In order to leave comments, you need to log in
Why activeNameClass in react-router only changes after page refresh?
This is what the sidebar looks like where clicks happen:
const sidebar = this.props.sidebar[0];
const content = sidebar ? (
Object.keys(sidebar).map(element => {
const className = `icon ${sidebar[element].icon}`;
const url = sidebar[element].url;
return (
<li key={element}>
<NavLink to={url} activeClassName="active">
<i className={className} />
<span className="text">{sidebar[element].text}</span>
</NavLink>
</li>
);
})
) : (
<div>Loading, please, waits</div>
);
.active
the last clicked element. If I then click, nothing happens. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question