I'm currently working on creating a function that will alter the background color of a website's homepage when a user clicks a specific button.
class App extends Component {
constructor(props) {
super(props);
this.state = {
quotes: [],
selectedQuoteIndex: null,
background: 'white'
}
this.changeBackground = this.changeBackground.bind(this);
}
changeBackground() {
return random(backgroundColor);
}
render() {
return (
<button onClick={this.changeBackground}/>
)
}
}
I'm unsure about where to place the code for returning the background color in my component.