diff --git a/src/LogMonitorEntry.js b/src/LogMonitorEntry.js index 039a776..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 } - expandRoot={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 344a4f9..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 (
: '' } + shouldExpandNode={this.shouldExpandNode} /> : '' } ); } + shouldExpandNode() { + return this.props.expandActionRoot; + } + render() { const { type, ...payload } = this.props.action; return (