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

React Native componentWillMount / componentDidMount not going triggered after pop navigating and navigate again


I am new in React Native ...just want ask nub question, my App wont triggered componentWillMount and componentDidMount when navigate back to other page, I use react-native-router-flux for navigator

componentWillMount() {
 this.props.searchRequest();
}

exp: I have homescreen and categories, from home I want go to categories: on categories I have that code, but sometime when I back to previouse page (homescreen) and back again on categories componentWillMount not triggered sometime,

I think my categories scene not unmounted


Solution

  • We can detect props change with

    componentWillReceiveProps()

    but we need set state to accommodate new props value,