If you have URLs in your app that can change (e.g /profile/1 and /profile/2, how do you access that from this.props.location.pathname?
In my Profile component I have a componentDidMount method like so:
componentDidMount () {
if (this.props.location.pathname === 'profile/:id/') {
console.log('is profile')
} else {
console.log('is not profile')
}
}
Which returns is not profile when I'm on the profile pages.
The project I'm using uses react-redux-starter-kit as a base (not sure if that helps), which uses react-router-v3.