`componentDidMount()` function is not called after navigation

后端 未结 9 1845
旧巷少年郎
旧巷少年郎 2020-12-09 03:38

I am using stackNavigator for navigating between screens. I am calling two API\'s in componentDidMount() function in my second activity. When i loa

9条回答
  •  甜味超标
    2020-12-09 04:13

    React-navigation keeps the component mounted even if you navigate between screens. You can use the component to react to those events :

     console.log('hello world')}
    />
    

    More info about this component here.

提交回复
热议问题