From 04e074503899f40cd80aae4bc4f928361e90ee1f Mon Sep 17 00:00:00 2001 From: Thomas Hudspith-Tatham Date: Sat, 16 Apr 2016 11:59:46 +0100 Subject: [PATCH 1/2] replace JSONTree.expandRoot with shouldExpandNode, fixes deprecation error --- src/LogMonitorEntry.js | 2 +- src/LogMonitorEntryAction.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LogMonitorEntry.js b/src/LogMonitorEntry.js index 039a776..c60e340 100644 --- a/src/LogMonitorEntry.js +++ b/src/LogMonitorEntry.js @@ -47,7 +47,7 @@ export default class LogMonitorEntry extends Component { this.props.select(this.props.previousState) : undefined } - expandRoot={this.props.expandStateRoot} + shouldExpandNode={() => this.props.expandStateRoot} style={styles.tree} /> ); } catch (err) { diff --git a/src/LogMonitorEntryAction.js b/src/LogMonitorEntryAction.js index 344a4f9..5c57654 100644 --- a/src/LogMonitorEntryAction.js +++ b/src/LogMonitorEntryAction.js @@ -24,7 +24,7 @@ export default class LogMonitorAction extends Component { : '' } + shouldExpandNode={() => this.props.expandActionRoot} /> : '' } ); } From 9095b355cb8254eb7310658437e9323be9f75f62 Mon Sep 17 00:00:00 2001 From: Thomas Hudspith-Tatham Date: Sat, 16 Apr 2016 12:16:09 +0100 Subject: [PATCH 2/2] removed arrow function from render method --- src/LogMonitorEntry.js | 7 ++++++- src/LogMonitorEntryAction.js | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/LogMonitorEntry.js b/src/LogMonitorEntry.js index c60e340..0c4421c 100644 --- a/src/LogMonitorEntry.js +++ b/src/LogMonitorEntry.js @@ -31,6 +31,7 @@ export default class LogMonitorEntry extends Component { constructor(props) { super(props); this.handleActionClick = this.handleActionClick.bind(this); + this.shouldExpandNode = this.shouldExpandNode.bind(this); } printState(state, error) { @@ -47,7 +48,7 @@ export default class LogMonitorEntry extends Component { this.props.select(this.props.previousState) : undefined } - shouldExpandNode={() => this.props.expandStateRoot} + shouldExpandNode={this.shouldExpandNode} style={styles.tree} /> ); } catch (err) { @@ -75,6 +76,10 @@ export default class LogMonitorEntry extends Component { } } + shouldExpandNode() { + return this.props.expandStateRoot; + } + render() { const { actionId, error, action, state, collapsed } = this.props; const styleEntry = { diff --git a/src/LogMonitorEntryAction.js b/src/LogMonitorEntryAction.js index 5c57654..aaef5f8 100644 --- a/src/LogMonitorEntryAction.js +++ b/src/LogMonitorEntryAction.js @@ -14,6 +14,11 @@ const styles = { }; export default class LogMonitorAction extends Component { + constructor(props) { + super(props); + this.shouldExpandNode = this.shouldExpandNode.bind(this); + } + renderPayload(payload) { return (
this.props.expandActionRoot} /> : '' } + shouldExpandNode={this.shouldExpandNode} /> : '' }
); } + shouldExpandNode() { + return this.props.expandActionRoot; + } + render() { const { type, ...payload } = this.props.action; return (