_this2.props.navigator.push is not a function

前端 未结 2 780
你的背包
你的背包 2020-12-12 02:58

I am trying to use Navigator within a React-Native app, but I am running into issues.

At the beginning of the app, I am loading this LoginScreen component:



        
2条回答
  •  萌比男神i
    2020-12-12 03:27

    You can do it with something like this:

    componentDidMount () {
    const {navigation} = this.props;
    navigation.addListener ('willFocus', () =>
      // run function that updates the data on entering the screen
    );
    }
    

提交回复
热议问题