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';
5
5
import nanoid from 'nanoid' ;
6
6
7
7
import TreeNode from './TreeNode' ;
8
+ import listShape from './listShape' ;
8
9
import nodeShape from './nodeShape' ;
9
10
10
11
class CheckboxTree extends React . Component {
11
12
static propTypes = {
12
13
nodes : PropTypes . arrayOf ( nodeShape ) . isRequired ,
13
14
14
- checked : PropTypes . arrayOf ( PropTypes . string ) ,
15
+ checked : listShape ,
15
16
disabled : PropTypes . bool ,
16
17
expandDisabled : PropTypes . bool ,
17
18
expandOnClick : PropTypes . bool ,
18
- expanded : PropTypes . arrayOf ( PropTypes . string ) ,
19
+ expanded : listShape ,
19
20
name : PropTypes . string ,
20
21
nameAsArray : PropTypes . bool ,
21
22
nativeCheckboxes : PropTypes . bool ,
Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ class TreeNode extends React.Component {
15
15
optimisticToggle : PropTypes . bool . isRequired ,
16
16
showNodeIcon : PropTypes . bool . isRequired ,
17
17
treeId : PropTypes . string . isRequired ,
18
- value : PropTypes . string . isRequired ,
18
+ value : PropTypes . oneOfType ( [
19
+ PropTypes . string ,
20
+ PropTypes . number ,
21
+ ] ) . isRequired ,
19
22
onCheck : PropTypes . func . isRequired ,
20
23
onExpand : PropTypes . func . isRequired ,
21
24
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