You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now when I press the Cartitem tab I want to refresh the component Cartitem.
Actual behaviour
Currently all tabs are loaded at the initial stage. when I use lazy load the tab loaded once I go to that tab. but when I visit that tab second time it does not reaload.
Environment
react-navigation ^1.0.0-beta.7:
react-native ^0.44.0:
Android 6.0:
react-navigation-is-focused-hoc
^1.0.0:
The text was updated successfully, but these errors were encountered:
Did you implement the component functions in the example?
componentWillReceiveProps(nextProps) {
if (!this.props.isFocused && nextProps.isFocused) {
// screen enter (refresh data, update ui ...)
}
if (this.props.isFocused && !nextProps.isFocused) {
// screen exit
}
}
shouldComponentUpdate(nextProps) {
// Update only once after the screen disappears
if (this.props.isFocused && !nextProps.isFocused) {
return true
}
// Don't update if the screen is not focused
if (!this.props.isFocused && !nextProps.isFocused) {
return false
}
// Update the screen if its re-enter
return !this.props.isFocused && nextProps.isFocused
}
Expected behaviour
Now when I press the Cartitem tab I want to refresh the component Cartitem.
Actual behaviour
Currently all tabs are loaded at the initial stage. when I use lazy load the tab loaded once I go to that tab. but when I visit that tab second time it does not reaload.
Environment
react-navigation ^1.0.0-beta.7:
react-native ^0.44.0:
Android 6.0:
react-navigation-is-focused-hoc
^1.0.0:
The text was updated successfully, but these errors were encountered: