re: Class definition in React VIEW POST

FULL DISCUSSION
 
 

👆 answers the question 👍

@kayut
And note that the state is initialized as a property outside of constructor, this. should be dropped.

class App extends React.Component {
  // not this.state but just state
  state = {
    count: 0
  };
  render() { ...  }
}
code of conduct - report abuse