What is the main purpose of constructor in react?

Forums ReactWhat is the main purpose of constructor in react?
Staff asked 2 years ago

Answers (1)

Add Answer
Staff answered 2 years ago

The constructor aids in constructing things. In React, the constructor is no different. It can be used to bind event handlers to the component and/or initializing the local state of the component.

Subscribe

Select Categories