Open
Description
Hello,
I am using react-tabs with with success in my app.
In some places though, I use it with no panel at all. In that case, it is used to change a property on another component.
Stripped down example to illustrate:
const [page, setPage] = useState(0);
<Tabs selectedIndex={page} onSelect={setPage}>
<TabList>{ /* one Tab per page here */ }</TabList>
</Tab>
<DocumentView url={url} page={page} />
This works perfectly.
However, react-tabs complains that
There should be an equal number of 'Tab' and 'TabPanel' in
Tabs
It then continues happily and everything works fine.
- Do you see any issue with this use case?
- If not, would it be possible to silence that warning when the number of
TabPanel
s is exactly 0?
Metadata
Assignees
Labels
No labels