Skip to content

Unable to make Tabs a controlled component #169

@iqra-javed

Description

@iqra-javed

Describe the bug
Unable to make Tabs component a controlled component — passing index does not update active tab

To Reproduce
Steps to reproduce the behavior:

  1. store tabIndex in local state
  2. pass tabIndex to the index prop on Tabs component
  3. create an onChange handler for Tabs component to update tabIndex: onChange={(index) => setTabIndex(index)}

Expected behavior
passing index and onChange should allow owner to control active index state

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions