reactjs / reactjs/react-tabs

Switch component and context instead of compound-components (cloning)

Open
#251 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
3.1k
Forks
455
Avg merge
5h 9m
Merged PRs (30d)
2

Description

The current structure makes react-tabs a little rigid when it comes to user-land abstractions, like being able to animate these components.

If it had something like a Switch component similar to react-router that takes the current tab and displays it, as well as communication via context instead of cloning elements, then it would be very easy to use things like reactTransitionGroup or Transition.

<Tabs>
    <TabList>
      <Tab>Mario</Tab>
      <Tab>Luigi</Tab>
    </TabList>

    <Transition from={{ opacity: 0 }} enter={{ opacity: 1 }} leave={{ opacity: 0 }}>
      {styles => (
        <Switch style={styles}>
          <TabPanel>Mario</TabPanel>
          <TabPanel>Luigi</TabPanel>
        </Switch>
      )}
    </Transition>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the current compound-component structure and how elements are cloned before deciding how a Switch component and context-based communication would fit. Define the API and behavior needed to support the described transition use case, then validate that existing tab behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.