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

active tab gets out of sync with rendered scene when routes change #1300

@megantaylor

Description

@megantaylor

Current behavior

when routes array changes, the indicator and label state in the tab bar get out of sync with the scene being rendered. it looks like the tab bar renders the tab at index 0 as active (with active label and indicator at that position), even though the scene being rendered is at a different index.

dynamicTabs.mov

Expected behavior

when routes change, the rendered scene and active tab ui (indicator and label state) should stay in sync, that is to say, the tab for the rendered scene should have the active state ui and the tab bar indicator should be in the correct position.

Reproduction

https://snack.expo.dev/@reachvote/react-native-tab-view-dynamic-tabs-bug

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Environment

package version
react-native-tab-view 3.1.1
react-native-pager-view 5.4.6
react-native 0.64.3
expo 43.0.2
node 14.17.1
yarn 1.22.10

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions