FlowRouter previous route?


#1

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 :).


#2

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.


#3

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


#4

I’m glad this works for you