Tabs with context provider in between <Tabs> and <Tablist>
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- javascript, react
- Domaine
- frontend
Piste de recherche
Aucun fichier source ni test n’est indiqué. Commencez par reproduire la structure DndProvider, Tabs, TabList et TabPanel, puis examinez comment l’avertissement compte les éléments Tab et TabPanel. C’est terminé lorsqu’une composition plaçant le provider en premier se rend sans l’avertissement tout en conservant un nombre égal d’éléments Tab et TabPanel.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hi all,
I'm working on creating a drag and drop version of react tabs using react-dnd.
React dnd requires a DndProvider context to be wrapped around any draggable/droppable objects. I'm currently trying to do something like this:
function DndTabs({data}) {
// (...Some functions that require the DndContext here...)
return (
<TabList>
{Object.keys(data).map(tabId => {
<Tab key={tabId}> tabId </Tab>
})}
</TabList>
)
}
function DndContainer({data}) {
return (
<DndProvider>
<DndTabs data={data} />
</DndProvider>
)
}
function TabHolder() {
return (
<Tabs>
<DndContainer data={data} />
{Object.keys(data).map(tabId => {
<TabPanel key={tabId}> tabId </TabPanel>
})}
</Tabs>
)
}
This is throwing the
Warning: Failed prop type: There should be an equal number of 'Tab' and 'TabPanel' in 'UncontrolledTabs' error, even though the actual rendered HTML should have tablist and tabpanels as siblings with an equal number of Tab and TabPanel elements.
I tried following the advice in #253 (calling the react component as a function instead of letting react render it) but this causes issues with the DndContext because functions that require the context to exist need to render after the Context itself renders.
Is there any structure that I can use that will make this work, following the additional constraint that the Provider for the Dnd Context needs to appear/render before the actual Tabs?
- Langage dominant
- JavaScript
- Étoiles
- 3.1k
- Forks
- 455
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de reactjs/react-tabs
-
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
reactjs/react-tabs#584 ·
-
className default is lost when props.className is undefined in UncontrolledTabsPeut-être pris @Shiva903-hue l’a pris il y a 268 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
reactjs/react-tabs#581 · 3 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
reactjs/react-tabs#571 ·
-
Support hiding of all TabPanelsOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
reactjs/react-tabs#525 · 1 commentaire · 1 réaction ·
-
Disabled tabs should remain keyboard focusable as per W3C WAI ARIA guidelinesPeut-être à nouveau libre @Jastagar l’a pris il y a 1049 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
reactjs/react-tabs#521 · 3 commentaires ·
Toutes les issues de reactjs/react-tabs
Issues similaires
-
type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
blamechris/chroxy#8579 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
modusensus/dsh-mneme#411 ·
-
Flaky (suspected): VideoTimelineEditor bed audio test sees 600px instead of 120px under CI loadOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
Actions on ToastsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
XRPLF/xrpl-dev-portal#4000 ·
Les mainteneurs répondent en général sous 1 jour