My code so far is
import './styles.scss';
import React from 'react';
import ReactDOM from 'react-dom';
class Quote extends React.Component {
constructor(props) {
super(props);
}
render() {
quote = bank.quotes[1]
return (
<div>
{quote}
</div>
)
}
}
const bank = [
{"quote": "I hear the jury's still out on science", "char":"Gob"},
{"quote": "Why should you go to jail for a crime someone else noticed? You don’t need double talk, you need Bob Loblaw.", "char":"Bob Loblaw"},
{"quote": "Steve Holt!", "char":"Steve Holt"},
{"quote": "Do you think I could have a hit of the juice box?", "char": "Buster"},
{"quote": "I don't care for Gob", "char": "Lucille"},
]
const rootDiv = document.getElementById('root');
ReactDOM.render(<Quote />, rootDiv);
I’m trying to pull quotes from within the bank object, and I’ve tried several different methods, but none of them seem to work. Where should I be storing my array with quotes in it and how would I properly pull from it?