Search code examples
react-native-router-flux

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 ?


Solution

  • Its hard to tell, but easier is pass variable when navigating out, like there:

    Actions.home({from: 'about'})
    

    now, Home props contain from variable, and you can handle this.