Update 14_component_life_cycles.md

pull/139/head
Mahmoud 3 years ago committed by GitHub
parent d0c066fcb9
commit 5b455fa2eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -97,7 +97,7 @@ ReactDOM.render(<App />, rootElement)
### Contructor
Nowadays we write class based-component without a constructor and we can write the state also outside the constructor. In older version React we the state used be always inside the constructor.
Nowadays we write class based-component without a constructor and we can write the state also outside the constructor. In older version of React, the state always used to be inside the constructor.
The constructor() method is executed before any other methods, when component is initiated and it is the place where to set the initial state and other values.
In class we use constructor parameter to inherit from parents and in React to the constructor take a props parameter and the super method has to be also called.

Loading…
Cancel
Save