0

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?

Stanley Luo
  • 3,689
  • 5
  • 34
  • 64
  • 3
    componentWillMount will be called first time a scene is pushed but if a scene is revisited via pop, there is no react lifecycle method call. There are many requests on github for this feature. It's not implemented. – suman j Jan 06 '17 at 03:43
  • @sumanj You mean the target component's, or the `Scene` itself's `componentWillMount`? – Stanley Luo Jan 06 '17 at 04:14

1 Answers1

0

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

constructor(props){
    fetch(url)
    then(doThings())
}
Fatemeh Majd
  • 719
  • 8
  • 22