Skip to content

Commit

Permalink
Fix proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Aug 30, 2023
1 parent ae2811c commit d91f391
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/pages/x/api/tree-view/tree-view.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
},
"defaultExpandIcon": { "type": { "name": "node" } },
"defaultParentIcon": { "type": { "name": "node" } },
"defaultSelected": { "type": { "name": "any" }, "default": "[]" },
"defaultSelected": {
"type": { "name": "union", "description": "Array&lt;string&gt;<br>&#124;&nbsp;string" },
"default": "[]"
},
"disabledItemsFocusable": { "type": { "name": "bool" } },
"disableSelection": { "type": { "name": "bool" } },
"expanded": { "type": { "name": "arrayOf", "description": "Array&lt;string&gt;" } },
Expand Down
5 changes: 4 additions & 1 deletion packages/x-tree-view/src/TreeView/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ TreeView.propTypes = {
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
* @default []
*/
defaultSelected: PropTypes.any,
defaultSelected: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
PropTypes.arrayOf(PropTypes.string),
PropTypes.string,
]),
/**
* If `true`, will allow focus on disabled items.
* @default false
Expand Down

0 comments on commit d91f391

Please sign in to comment.