My component was rendering perfectly fine, but when I added the last two properties to the element, the component stopped rendering properly. I tested it by typing one part at a time, and it seems like it renders perfectly fine until I add a number in the bracket to pull an element out, in my case Math.floor(Math.random() * 3). I tried using a simple int as well, but it didn’t like that either.
class RQMApp extends React.Component {
constructor(props) {
super(props);
this.state = {
quotes: ["9 + 10 = 21", "waboody daboody", "I'm breathin' different"],
authors: ["Anonymous", "Fresh215", "Ace"],
currentQuote: this.quotes[Math.floor(Math.random() * 3)],
currentAuthor: this.authors[this.quotes.indexOf(this.currentQuote)]
}
}
newQuote(){
}
render() {
return (
<div id="quote-box">
<p>bklkkllklklkdfklppp</p>
</div>
);
}
}
ReactDOM.render(
<RQMApp />,
document.getElementById('root')
);