If You are Using Pathname In your Code and you are facing this error then you need to use pathname just like this. Accessing pathname in react-router-4 has been changed So you can access pathname Just like this. If You are using React-Router-3 and earlier Then Use this: this.props.location.pathname If you are using React-Router-4 then use this: this.props.history.location.pathname And now, Your error must be solved.