Super
- In ReactJS super call other constructor methods that is instantiated.
- In ReactJS, it is used to access parent properties and methods from the child components.
- It is used in an overridden method in react.js
- Super is reside always inside the constructor.
- Super is essential whenever the constructor is there in ReactJ S.
- It is important to call super before the object initializes i.e, before using this.state in the constructor if it’s not there then the code gives a bug.
React Constructor and Super Keyword
In this article, we will learn about the React Constructor and Super keyword. In React JS constructor is used for class components not for the functional component. In React JS super call other constructor methods that is instantiated.
Table of Content
- Constructor
- Super