Switch component and context instead of compound-components (cloning)
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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