Using deconstructors for faster rendering

This commit is contained in:
Minesh 2018-10-26 18:44:45 +01:00
parent 92a9ad2feb
commit 41d7f6e56f

View file

@ -17,19 +17,18 @@ class VerticalCollapsibleSplit extends React.Component {
let { let {
props, props,
state, state,
collapse,
} = this; } = this;
return ( return (
<div className={'vertical-split'}> <div className={'vertical-split'}>
<div className='visible-content' data-name={this.props.name}> <div className='visible-content' data-name={props.name}>
{this.props.top} {props.top}
<button className='collapse-button' onClick={this.collapse}> <button className='collapse-button' onClick={this.collapse}>
{this.state.closed ? <Icon.PlusCircle className='plus-icon' /> : <Icon.MinusCircle /> } {state.closed ? <Icon.PlusCircle className='plus-icon' /> : <Icon.MinusCircle />}
</button> </button>
</div> </div>
<div className='collapse-content' data-name={this.props.name}> <div className='collapse-content' data-name={props.name}>
{this.props.bottom} {props.bottom}
</div> </div>
</div> </div>
); );