Hi guys,
Did a good amount of research on older issues but cannot find an answer to my problem. My IndexRoute always remain active even when I switch to another route. My code:
<Router>
<Route path="/" component={App}>
<Route path="PlaylistManager" component={PlaylistManager}>
<IndexRoute component={CurrentPlaylist}/>
<Route path="/n+1" component={NextPlaylist}/>
</Route>
<Route path="SongsBacklogManager" component={SongsBacklogManager}>
<IndexRoute component={UntreatedTracks}/>
<Route path="/used" component={UsedTracks}/>
<Route path="/storage" component={StoredTracks}/>
</Route>
</Route>
</Router>
// And somewhere else:
<ul>
<li><Link activeClassName="activeBoSecondary" to="SongsBacklogManager">New</Link></li>
<li><Link activeClassName="activeBoSecondary" to="used">Used</Link></li>
<li><Link activeClassName="activeBoSecondary" to="storage">Storage</Link></li>
</ul>
Then, if I click on the "Used" Link for instance, the class activeBoSecondary remains appended on the index route being "SongsBacklogManager"
Hope I'm not doing anything really wrong. Thanks in advance!
Thanks for your question!
We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router.
Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router.
We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46.
All right, I will post on StackOverflow. I just felt it was a bug rather than a question, but I might be wrong.
Just solved my issue, you were right (using IndexLink instead of Link, for those who might be interested). Sorry about that!
Most helpful comment
Just solved my issue, you were right (using IndexLink instead of Link, for those who might be interested). Sorry about that!