idev0085 / react-boilerplate

0 stars 0 forks source link

What is the purpose of using super constructor with props argument? #49

Open idev0085 opened 3 years ago

idev0085 commented 3 years ago

So to ensure that the React. Component 's constructor() function gets called, we call super(props) . super(props) is a reference to the parents constructor() function, that's all it is. We have to add super(props) every single time we define a constructor() function inside a class-based component.