FlowRouter previous route?


Hey guys,

Is there a way to get the previous route on FlowRouter? For instance the app is on route X, I go to route Y, and I want to be able to know that my last route was X.

Thanks if anyone can help :).


I’m afraid that FlowRouter does not have that built in. But it is easy. What you need to do is to set a global trigger that stores the routes visited in an array. Then whenever you need to know the previous route, just get the last item of the array.


Ahh of course I should have thought of that! Thanks @illustreets


I’m glad this works for you