1.import withNavigationFocus from react-navigation to your class .

2.hen export your like this : export default withNavigationFocus(yourclassname)

3.use this code to update or manage your state:

 shouldComponentUpdate = (nextProps, nextState) => {
if (nextProps.isFocused) {
  ...
  return true;
} else {
  ...
  return false;
}

};

 

相关文章:

  • 2022-02-24
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-08
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-07-12
  • 2021-10-29
相关资源
相似解决方案