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