react native route flux re-render component on stack pop

前端 未结 2 831
悲哀的现实
悲哀的现实 2021-01-23 18:53

How do you re-run React Component Lifecycle methods to determine if a re-render is necessary when transitioning back to previous screens from stack using React Native Router Flu

2条回答
  •  無奈伤痛
    2021-01-23 19:29

    Work Around that works! This workaround seems to be hacky. There must be a better way to hook into component lifecycle to determine if a re-render is required.

     { Actions.pop(); setTimeout(()=> Actions.refresh(), 500)}} style={styles.cancel}>
    

    This will call shouldComponentUpdate() method which gives an option to determine, if a re-render is required.

提交回复
热议问题