Skip to content
This repository was archived by the owner on Oct 27, 2021. It is now read-only.
This repository was archived by the owner on Oct 27, 2021. It is now read-only.

Rerendering TabBarBottom #78

Open
Open
@ifalldev

Description

@ifalldev

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).

  1. I have an app with bottom navigation and one of the tabs has a badge with a count of notifications

  2. The notifications is fetch when the app starts but the component have to wait the server response

  3. The response arrive and change the redux state and the component props as well

  4. The badge doesn't shows up because the navigation is still on same index and the TabBarBottom doesn't rerender

  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions