I saw different examples where some people use state while others use this.state. I still don't understand when to use what. In examples using Mapbox or Meteor I only see this.state.
ex1:
export default class SomeComponent extends Component {
state = { someState }
render() {
return (
<Something-to-render-that-uses-state>
);
}
}
ex2:
export default class SomeComponent extends Component {
constructor(props) {
super(props);
this.state = { someState }
}
render() {
return (
<Something-to-render-that-uses-state>
);
}
}