`componentDidMount()` function is not called after navigation

后端 未结 9 1846
旧巷少年郎
旧巷少年郎 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:10

    //na pagina que você quer voltar
    import {NavigationEvents} from 'react-navigation';
    
    async atualizarEstado() {
      this.props.navigation.setParams({
      number: await AsyncStorage.getItem('count'),
    });}
    
    render() {
    return (
      
         this.atualizarEstado()} />
      
    );
    }
    

提交回复
热议问题