Open literat opened 2 years ago
IMO, this is rather a halfway solution. I can imagine:
a) No magic:
<Tabs>
<TabList>
<TabItem />
<TabItem />
</TabList>
<TabContent>
<TabPane />
<TabPane />
</TabContent>
</Tabs>
b) Full magic:
<Tabs>
<TabPane title="pane 1" active />
<TabPane title="pane 2" />
</Tabs>
I think this is related to/duplicated by #365.
I think that it is not necessary using
Tab
andTabsContent
for a developer. Maybe the structure can be simplified toba using
React.Children
to parse children and sort them into items and panes arrays and then render inTab
wrapper andTabContent
wrapper.References: