How change the @import according to value button in React?
Example of how i want: i have the this.state.modal = false
.js:
handleChange = () => {
this.setState({
modal: !this.state.modal
})
}
<button onClick={this.handleChange}>Test</button>
and my .scss:
if(this.state.modal === true) {
@import 'theme/white';
} else {
@import 'theme/black';
}
of course i can't call if with .scss but basically is this what i want