class App extends React.Component {
constructor(props) {
// Required step: always call the parent class' constructor
super(props);
// Set the state directly. Use props if necessary.
this.state = {
counter: 0,
}
}
render() {
// whatever you like
}
}