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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -