Is there a shorter/inline version of doing this in react, basically applying a single css attribute conditionally?
setStyle () {
const style = {
display: 'flex',
flexDirection: 'column',
height: 485
}
if (this.state.zoom) {
style.position = 'absolute'
}
return style
}
<div ref='container' style={this.setStyle()}>
Something in this context:
style={{
display: 'flex',
flexDirection: 'column',
height: 485
position: absolute // Make this conditional
}}