April 2018
Intermediate to advanced
284 pages
6h 43m
English
The constructor method of React Component gets invoked first when the component is mounted. Here, we can set the state of the component.
Here's an example of constructor in React.Component:
constructor(props) { super(props); this.state = { value: props.initialValue }; }