Skip to content

[Tabs] Invalid value warning triggered when using React.lazy #29209

@iluvmemes

Description

@iluvmemes

v5.0.4

Much like the description in #8489, when using dynamic data to generate tabs and their contents, I receive the error:

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.

However, this only occurs once in our app after a hard refresh. I have reproduced this in a code sandbox however, it seems that there may be some caching with codesandbox.io that prevents it from happening.

In order to reproduce it in Codesandbox, you will need to add or remove a dependency such as lodash or something from the fork.

https://codesandbox.io/s/sparkling-grass-sfidi?file=/src/TabIssue.jsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists.scope: tabsChanges related to the tabs.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions