Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.

Commit d300d30

Browse files
committed
Merge pull request #13 from cpylua/master
Expose root node initial expand in props
2 parents a454798 + 839029c commit d300d30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default class JSONTree extends React.Component {
3333
};
3434

3535
static defaultProps = {
36+
expandRoot: true,
3637
theme: solarized,
3738
getArrowStyle: getEmptyStyle,
3839
getListStyle: getEmptyStyle,
@@ -55,7 +56,8 @@ export default class JSONTree extends React.Component {
5556
getLabelStyle: this.props.getLabelStyle,
5657
getValueStyle: this.props.getValueStyle
5758
};
58-
const rootNode = grabNode(keyName, this.props.data, this.props.previousData, this.props.theme, getStyles, this.props.getItemString, true);
59+
const {data, previousData, theme, getItemString, expandRoot} = this.props;
60+
const rootNode = grabNode(keyName, data, previousData, theme, getStyles, getItemString, expandRoot);
5961
return (
6062
<ul style={{
6163
...styles.tree,

0 commit comments

Comments
 (0)