There's a potential bug I found in react router. In my component, I do this:
if(this.props.location.pathname === "/home")
to check whether the user is at a path. It can be buggy, because the above condition is false
if the user enters the URL manually, like example.com/home/
How to handle this case? It's ugly to do multiple checking like this:
if(this.props.location.pathname === "/home" || this.props.location.pathname === "/home/"))
Any suggestions on how I could do this in a better and cleaner way?