Skip to content

Commit

Permalink
[lab][TabContext] Support number type in value (mui#40829)
Browse files Browse the repository at this point in the history
Co-authored-by: S Srinidhi <[email protected]>
  • Loading branch information
2 people authored and mostafa-rio committed Feb 3, 2024
1 parent b85edef commit fe7dc4f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/pages/material-ui/api/tab-context.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"props": {
"value": { "type": { "name": "string" }, "required": true },
"value": {
"type": { "name": "union", "description": "number<br>&#124;&nbsp;string" },
"required": true
},
"children": { "type": { "name": "node" } }
},
"name": "TabContext",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-lab/src/TabContext/TabContext.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface TabContextProps {
/**
* The value of the currently selected `Tab`.
*/
value: string;
value: string | number;
}
/**
*
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-lab/src/TabContext/TabContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/**
Expand Down

0 comments on commit fe7dc4f

Please sign in to comment.