Search code examples
react-nativereact-native-router-flux

React-native-router-flux: is there an OnEnter method?


I have spent my entire morning reading the docs, but can't find simple OnEnter() method, like in react-router. I'm using the latest version.

I need to fetch some resources when entering some specific Scene. Any idea?


Solution

  • you can use either constructor or componentWillMount functions in the scene component.

    constructor(props){
        fetch(url)
        then(doThings())
    }