I am trying to have a button change it's styling based on it's current state.
This following is my current attempt:
<Button
id="1W"
size="sm"
style={[this.state.timeSpan === '1W' ? btnActive : btnInactive]}
onClick={this.handleSpan}
>
Initially I was getting this error ->
"TypeError: CSS2Properties doesn't have an indexed property setter for '0' ".
Which I didn't know how to fix.
Now the page won't even load at all.
Is there something wrong with my syntax. Or possibly is there a better overall approach to what I trying to achieve?