Material UI Tabs: Nested tabs results in an invalid value error

Viewed 170

Having nested tabs results in the following error in the console:

MUI: The value provided to the Tabs component is invalid. The Tab with this value ("0") is not part of the document layout. Make sure the tab item is present in the document or that it's not display: none.

In the Basic tabs example in the docs, the TabPanel component has the following check: value === index. Including this in my TabPanel fixes this issue, however I need the child components to stay mounted and just be hidden. Having this check causes the tab content to be unmounted.

CodeSandbox example of the issue

Similar issue on Material UI's GitHub

0 Answers
Related