react-router: Can't do isActive check
Hi,
I have route
<Route path="/catalog/:category" component={CatalogList} />
When I’m on page /catalog/10, for example, I try to check is that route active
this.context.router.isActive('/catalog/:category')
But I got false always. How to check this?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (4 by maintainers)
@natelaws Yes, that is the correct behavior. It is so you can place CSS classes on “active” parts of the tree, or do more complex layout changes depending on what routes are active.