File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,18 @@ import React from 'react';
55import nanoid from 'nanoid' ;
66
77import TreeNode from './TreeNode' ;
8+ import listShape from './listShape' ;
89import nodeShape from './nodeShape' ;
910
1011class CheckboxTree extends React . Component {
1112 static propTypes = {
1213 nodes : PropTypes . arrayOf ( nodeShape ) . isRequired ,
1314
14- checked : PropTypes . arrayOf ( PropTypes . string ) ,
15+ checked : listShape ,
1516 disabled : PropTypes . bool ,
1617 expandDisabled : PropTypes . bool ,
1718 expandOnClick : PropTypes . bool ,
18- expanded : PropTypes . arrayOf ( PropTypes . string ) ,
19+ expanded : listShape ,
1920 name : PropTypes . string ,
2021 nameAsArray : PropTypes . bool ,
2122 nativeCheckboxes : PropTypes . bool ,
Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ class TreeNode extends React.Component {
1515 optimisticToggle : PropTypes . bool . isRequired ,
1616 showNodeIcon : PropTypes . bool . isRequired ,
1717 treeId : PropTypes . string . isRequired ,
18- value : PropTypes . string . isRequired ,
18+ value : PropTypes . oneOfType ( [
19+ PropTypes . string ,
20+ PropTypes . number ,
21+ ] ) . isRequired ,
1922 onCheck : PropTypes . func . isRequired ,
2023 onExpand : PropTypes . func . isRequired ,
2124
Original file line number Diff line number Diff line change 1+ import PropTypes from 'prop-types' ;
2+
3+ const listShape = PropTypes . oneOfType ( [
4+ PropTypes . arrayOf ( PropTypes . string ) ,
5+ PropTypes . arrayOf ( PropTypes . number ) ,
6+ ] ) ;
7+
8+ export default listShape ;
You can’t perform that action at this time.
0 commit comments