I'm new to React and I'm writing a simple class and trying to figure out where is the best place to initialize the state, should I do it in a constructor like this:
Class Quotes extends Component {
constructor(props) {
super(props);
this.state = {
color: 'blue'
};
}
...
Or as a state property like this:
Class Quotes extends Component {
state = {
color: 'blue'
};
...
Which one is better practice? and what are the advantages and disadvantages of both?