My goal is to enable a \"Go Back\" button, but only if the route/path the user would go back to is in a certain category.
More precisely I have two kinds of Routes
The history object has entries and the current index. I used these in the following way:
var lastLocation = history.entries[history.index - 1]; var lastUrl = lastLocation.pathname;