From 28610ae4c379d3f1ca6c15df2ed36a631ab9e73e Mon Sep 17 00:00:00 2001 From: momin-riyadh Date: Wed, 14 Oct 2020 21:42:44 +0600 Subject: [PATCH] minor spelling and function name fix --- 14_Day_Component_Life_Cycles/14_component_life_cycles.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 36060ae..f096d00 100644 --- a/14_Day_Component_Life_Cycles/14_component_life_cycles.md +++ b/14_Day_Component_Life_Cycles/14_component_life_cycles.md @@ -21,7 +21,7 @@ - [Component Life Cycles](#component-life-cycles) - [What is component life cycle](#what-is-component-life-cycle) - [Mounting](#mounting) - - [Contructor](#contructor) + - [Constructor](#contructor) - [getDerivedStateFromPros](#getderivedstatefrompros) - [Render](#render) - [ComponentDidMount](#componentdidmount) @@ -95,9 +95,9 @@ const rootElement = document.getElementById('root') ReactDOM.render(, rootElement) ``` -### Contructor +### Constructor -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 React we the state used be always 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. @@ -219,7 +219,7 @@ ReactDOM.render(, rootElement) ### ComponentDidMount -As we can understand the name of the method that this method called after component is render. This a place place to setting time interval and calling API. Look at the following setTimeout implementation in componentDidMount method. +As we can understand the name of the method that this method called after component is render. This a place to setting time interval and calling API. Look at the following setTimeout implementation in componentDidMount method. ```js import React, { Component } from 'react'