createBottomTabNavigator: 怎么在切换tab的时候让页面重新渲染


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;
}

};

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM