javascript - How to make a style change when a property is "true" -
i'm using material-ui, react
class app extends component { constructor() { super(); this.state = { draweropened: true }; }; render () { return( <div> <drawer open={this.state.draweropened}> <div style={{paddingleft: '256px'}}> </div> </div>
i want padding-left when drawer open (true), how remove padding when closing drawer?
<div style={{paddingleft: this.state.draweropened ? '256px' : 'initial'}}>
Comments
Post a Comment