DVGY
1
In Random Machine Quote Challenge, when i click the NEW
button how do i change the body background-color: this.state.color
.
What ever value is in my color
properties i want it to reflect it to body.
I tried document.body.style = 'background: red;';
. It does not take color property .
This is link of of code .
Thanks
You can use a div instead of a fragment and give it some inline styles.
<div style={{height: "100%", background: this.state.color}}>
<QuoteBox
color={this.state.color}
click={this.state.click}
onGetQuote={this.handleGetQuote}
quote={this.state.quote}
author={this.state.author}
/>
</div>
You may also want to look at the range of the index you are generating for the colorCodeHex
array.
DVGY
3
Thank you. so much it solved my issue