Tab 'selected=true' causes React.Children.only error
The simplest scenario for tabs:
const TabPanel = () => (
<Tabs>
<Tab title="a" selected={true}/>
<Tab title="b"/>
</Tabs>
);
Causes an error
“React.Children.only expected to receive a single React element child”
If one removes the selected={true} or changes to selected={false} it works.
Any way you can show more code, I'm unable to duplicate this. thanks.
I get the same Error if I add attribute "selected". But when I remove selected tag , It work or if I set selected={false} It work again.
@jacobcyl Unable to reproduce this. Can you show me the code that is causing this error?
I found the answer! because the
<Tabs>
<Tab>
<SomeOtherComponent />
</Tab>
</Tabs>