[TabPanel] Type mismatch between tabContext and tanPanel #44149
Labels
component: tabs
This is the name of the generic UI component, not the React module!
package: lab
Specific to @mui/lab
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Steps to reproduce
According to TabPanel's type definition, value must be a string.
https://github.com/mui/material-ui/blob/v6.1.4/packages/mui-lab/src/TabPanel/TabPanel.d.ts#L24
But according to TabContext's type definition, value must be a string or number.
https://github.com/mui/material-ui/blob/v6.1.4/packages/mui-lab/src/TabContext/TabContext.d.ts#L16
When using TabContext, because the currently active tab information is stored in the Context and compared within the TabPanel component, the
value
of the two components must use the same type.https://github.com/mui/material-ui/blob/v6.1.4/packages/mui-lab/src/TabPanel/TabPanel.js#L50
Current behavior
The
value
of TabContext and TabPanel are using different types.Expected behavior
The
value
of TabContext and TabPanel must use the same type.Context
No response
Your environment
npx @mui/envinfo
Search keywords: TabPanel
The text was updated successfully, but these errors were encountered: