diff --git a/docs/pages/material-ui/api/tab-context.json b/docs/pages/material-ui/api/tab-context.json index 165bbe9cb41145..9a6e0b870f4894 100644 --- a/docs/pages/material-ui/api/tab-context.json +++ b/docs/pages/material-ui/api/tab-context.json @@ -1,6 +1,9 @@ { "props": { - "value": { "type": { "name": "string" }, "required": true }, + "value": { + "type": { "name": "union", "description": "number
| string" }, + "required": true + }, "children": { "type": { "name": "node" } } }, "name": "TabContext", diff --git a/packages/mui-lab/src/TabContext/TabContext.d.ts b/packages/mui-lab/src/TabContext/TabContext.d.ts index f37f7c88a3f22e..b3db92467f8936 100644 --- a/packages/mui-lab/src/TabContext/TabContext.d.ts +++ b/packages/mui-lab/src/TabContext/TabContext.d.ts @@ -13,7 +13,7 @@ export interface TabContextProps { /** * The value of the currently selected `Tab`. */ - value: string; + value: string | number; } /** * diff --git a/packages/mui-lab/src/TabContext/TabContext.js b/packages/mui-lab/src/TabContext/TabContext.js index c4332280d7bc4d..a910236bab70b1 100644 --- a/packages/mui-lab/src/TabContext/TabContext.js +++ b/packages/mui-lab/src/TabContext/TabContext.js @@ -41,7 +41,7 @@ TabContext.propTypes /* remove-proptypes */ = { /** * The value of the currently selected `Tab`. */ - value: PropTypes.string.isRequired, + value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, }; /**