Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get previous scene name in react native router flux

I need to get a previous scene key in componentWillMount using react-native-router-flux to checkout what screen I come back from and make some action on condition. I looked through a lot but haven`t found an answer. Are there any ways to do that ?

like image 418
Radha Kotecha Avatar asked Dec 10 '22 06:12

Radha Kotecha


1 Answers

You can achieve this via Actions.prevScene, which will return the key of the previous scene in your stack.

like image 169
sftgf Avatar answered Dec 29 '22 04:12

sftgf