React Router 5.1 - useLocation hook - determine past locations
问题 According to React Router 5.1 documentation it should be possible to see "where the app is now, where you want it to go, or even where it was". In my app I need to see "where it was" - what locations I have visited before landing at a specific location. More precisely; I wish to find a prevoious location matching a certain pattern. That location might be two or three locations ago. However - I cannot figure out how to perform this. What is the best and recommended approach to achieve this?