Refresh previous screen on goBack()

前端 未结 11 1787
天命终不由人
天命终不由人 2020-12-13 09:34

I am new to React Native. How can we refresh/reload previous screen when returning to it by calling goBack()?

Lets say we have 3 screens A, B, C:

<
11条回答
  •  攒了一身酷
    2020-12-13 10:15

    On your screen B constructor will work like magic :)

        this.props.navigation.addListener(
              'didFocus',
              payload => {
                this.setState({is_updated:true});
              }
        );
    

提交回复
热议问题