What is component constructor in React JS ?
welcome to React Tutorials 2022 with simple examples !
React Component Constructor
If there is a constructor() function in your component, this function will be called when the component gets initiated. The constructor function is where you initiate the component's properties. In React, component properties should be kept in an object called state.
The constructor function is also where you honor the inheritance of the parent component by including the super() statement, which executes the parent component's constructor function, and your component has access to all the functions of the parent component (React.Component).
#constructor
#reactjs
#2022