How to trigger an event when a component is shown when using react-native-navigation?

前端 未结 6 1553
野趣味
野趣味 2021-02-02 09:35

I am using react-native with react-native-navigation. I would like to reload data when a component is shown. The component is shown when a user clicks on a tab navigation button

6条回答
  •  别那么骄傲
    2021-02-02 10:02

    Override componentWillMount lifecycle method: https://facebook.github.io/react/docs/component-specs.html#mounting-componentwillmount Or just put the functionality inside render method

提交回复
热议问题