Skip to content

Commit cb6ccb9

Browse files
committed
Adding support to React node type (string or jsx tags) to the node label.
1 parent 01e5d7e commit cb6ccb9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Individual nodes within the `nodes` property can have the following structure:
110110

111111
| Property | Type | Description |
112112
| ----------- | ------ | ------------------------------- |
113-
| `label` | string | **Required**. The node's label. |
113+
| `label` | mixed | **Required**. The node's label. |
114114
| `value` | mixed | **Required**. The node's value. |
115115
| `children` | array | An array of child nodes. |
116116
| `className` | string | A className to add to the node. |

src/js/TreeNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TreeNode extends React.Component {
1010
disabled: PropTypes.bool.isRequired,
1111
expandDisabled: PropTypes.bool.isRequired,
1212
expanded: PropTypes.bool.isRequired,
13-
label: PropTypes.string.isRequired,
13+
label: PropTypes.node.isRequired,
1414
optimisticToggle: PropTypes.bool.isRequired,
1515
showNodeIcon: PropTypes.bool.isRequired,
1616
treeId: PropTypes.string.isRequired,

src/js/nodeShape.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from 'prop-types';
22

33
const nodeShape = {
4-
label: PropTypes.string.isRequired,
4+
label: PropTypes.node.isRequired,
55
value: PropTypes.oneOfType([
66
PropTypes.string,
77
PropTypes.number,

0 commit comments

Comments
 (0)