Difference between constructor and getInitialState ?
Answer / Abhilash Pandey
In React, `constructor` is used for initializing state variables using the `super(props)` call and binding event handlers. On the other hand, `getInitialState()` function was deprecated in ES6 class components as it has been replaced by the `state` object. The constructor is necessary to bind methods to the component instance.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the controlled components and uncontrolled components in reactjs?
What is ReactDOM and what is the difference between ReactDOM and React?
What is the difference between state and props in react js?
How can you embed two or more components into one?
What is the component lifecycle in reactjs?
Which is best react or angular?
What are the lifecycle methods of reactjs components?
What is the life cycle of reactjs components?
What are lifecycle hooks react?
What are refs in reactjs?
What is ComponentWillMount()?
How events are different in react?