1class App extends React.Component {
2 constructor(props) {
3 super(props);
4
5 this.state = {};
6 }
7
8 // React says we have to define render()
9 render() {
10 return <div>Hello world</div>;
11 }
12};
1here is only one reason when one needs to pass props to super():
2
3When you want to access this.props in constructor.
4
5