3

As described in the title, I'm using react-router-dom and HashRouter to serve a client side app in a portion of my site.

What I'm trying to achieve is something like a back button to pop through the history. This is fine in normal situations, but the history seems to contain the entire browser history - so if someone links directly to a page and click the back button, it will take them back to the previous site.

I'd like to be able to detect when this is the case (i.e. the last thing in the history was not within the hash history) - that way I could do something different.

Thanks in advance for the help

Matt

Matt Whetton
  • 6,616
  • 5
  • 36
  • 57

0 Answers0