From 5b455fa2ebff1d8122269252c5df24adc483d844 Mon Sep 17 00:00:00 2001 From: Mahmoud Date: Sun, 27 Feb 2022 09:14:01 +0200 Subject: [PATCH] Update 14_component_life_cycles.md --- 14_Day_Component_Life_Cycles/14_component_life_cycles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/14_Day_Component_Life_Cycles/14_component_life_cycles.md b/14_Day_Component_Life_Cycles/14_component_life_cycles.md index fb00594..3d38552 100644 --- a/14_Day_Component_Life_Cycles/14_component_life_cycles.md +++ b/14_Day_Component_Life_Cycles/14_component_life_cycles.md @@ -97,7 +97,7 @@ ReactDOM.render(, 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.