Rerendering TabBarBottom #78
Description
Do you want to request a feature or report a bug?
I think its kind both.
What is the current behavior?
If the current behavior is a bug, please provide necessary steps for reproduction of this issue, or better the reduced test case (without any external dependencies, if possible).
-
I have an app with bottom navigation and one of the tabs has a badge with a count of notifications
-
The notifications is fetch when the app starts but the component have to wait the server response
-
The response arrive and change the redux state and the component props as well
-
The badge doesn't shows up because the navigation is still on same index and the
TabBarBottom
doesn't rerender -
Changing the active tab the
TabBarBottom
rerender and the badge shows up
What is the expected behavior?
The TabBarBottom
rerender even with the same index navigation if I want
To work in my scenario I commented out those lines:
shouldComponentUpdate(nextProps: Props) {
const { index } = this.props.navigationState
const { index: nextIndex } = nextProps.navigationState
return index !== nextIndex
}
Environment (include versions). Did this work in previous versions?
- React-Native (version):
0.52.0
- React-Router (version):
^4.2.0
- React-Router-Navigation (version):
1.0.0-rc.4
I can work on a PR if that feature is good to the package as whole.