{"id":989,"date":"2021-11-10T05:05:39","date_gmt":"2021-11-10T05:05:39","guid":{"rendered":"https:\/\/www.liainfraservices.com\/kbarticles\/?post_type=tesserakb&#038;p=989"},"modified":"2021-11-12T03:43:26","modified_gmt":"2021-11-12T03:43:26","slug":"fundamental-concepts-of-reactjs","status":"publish","type":"tesserakb","link":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/","title":{"rendered":"Fundamental concepts of ReactJS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this article, we will look into the <strong>fundamental concepts of ReactJS<\/strong> well suitable for beginners. If you are aware of HTML and JavaScript basics then React Native concepts will be easy to work with React Modules and understand different lifecycle methods. At <strong>Lia Infraservice<\/strong> we create Dynamic Websites. Become a front-end React JS developer and be a part of our tech-savvy&nbsp;<a href=\"https:\/\/www.liainfraservices.com\/web-app-development-company-in-chennai\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>Web App Development Company in Chennai<\/strong>.&nbsp;&nbsp;<\/span><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Fundamental Concepts of React JS an Overview?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">React is an open-source, front end, JavaScript library used for building <a href=\"https:\/\/www.liainfraservices.com\/ui-ux-design-services\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">User Interfaces &#8211; UI<\/span><\/a> components. It is initially developed by Facebook for a purpose and maintained by a community of individual developers and companies. It breaks down complex UIs into small, isolated code called \u201ccomponents\u201d.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Components are independent and reusable. They can either be JavaScript functions or classes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Role of React JS:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Whenever there is a change in any part of the application due to real-time updates or user input, that part only is loaded asynchronously to reflect the updated state. It means the respective &#8211; &#8220;Document Object Model&#8221; (DOM) container should be updated periodically to reflect the changes to the client.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>For Example:<\/strong>&nbsp;<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">When you add a new comment in Facebook, it makes an asynchronous request to the server to save this comment in the database, and update the DOM to reflect the current state.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">React is not a framework. It is just a library developed by Facebook to solve some problems that we were facing earlier.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Build your React App With&nbsp;<strong><a href=\"https:\/\/www.liainfraservices.com\/services\" target=\"_blank\" rel=\"noreferrer noopener\">Lia Infraservices<\/a><\/strong>&nbsp;&#8211;&nbsp;<strong>Leading <span class=\"has-inline-color has-vivid-cyan-blue-color\"><a href=\"https:\/\/www.liainfraservices.com\/mobile-app-development-company-in-chennai\" target=\"_blank\" rel=\"noreferrer noopener\">Mobile App Development Company in Chennai<\/a>.<\/span><\/strong><\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">1. How to Create a Simple React Application?<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">Open terminal in visual studio code :&nbsp;<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Install create-react-app by running this command in your terminal:<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">C:\\Users\\LIA&gt;npm install -g create-react-app<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Run this command to create a React application :&nbsp;<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">C:\\Users\\LIA&gt;npx create-react-app myfirstreact<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/nZY_9Xzxk6KHoTWBtDS1PvS88KR_vjdnjLvY_l3xhf44YgD3npIWndr3oS9WAH-NAuS7mZ0zoOYgSQIvxx5-aQhTJaNeJWgyYLBv_yDgPp_tgahi6o-voryZCnbhNw3wNT_N7ZgV\" alt=\"\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Run this command to execute the React application:<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">C:\\Users\\LIA&gt;npm start<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/vJpeNeNp8QHiu41iS-faJCYUD-4B5Xxi6ZV7s8PPoLidIsqWAB90OoJ-xrTM7XmWbWxLFSgERHKsmH19hLF5n1kjy2plGwIdGWmlGoO2xtgetiI9fOFMdcccA8z3pTiwZU80znpV\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Hello world Example:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Change the code of App.js from src folder<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">import React, { Component } from &#8216;react&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/\/import &#8216;.\/App.css&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">class App extends Component {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;render() {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;return (<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div className=&#8221;App&#8221;&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;Hello World!&lt;\/h1&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/div&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">export default App;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/4cIeCllazaKlXbylFi-WIYqdb_v6RK7fjhAWvHTYV-QT-09CB0ug0UdJlryAuI09nYb9pF9veR-J6Fs2RYPq0fQYGRl8j7YA2T6RzGXVR-bIjtnnPlKiqoOjz5kiA6VzjMRUJ78T\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> If u did not use&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">export default App;<\/p>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p>It returns an <strong>error<\/strong>&nbsp;<\/p><\/blockquote><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/KGyvImYCDs2AcpwyKZs4arpweTeGbsLqX0CyrRNxDbOiENKPndOuLGvNFnjuZDxeUXa-oZpFqy86rr05sYJxHwiO0lTdtFvvFwlOg9DnqdCxa7GajIpQZUu97P72Q98mzMl1IaEW\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2. <strong>Folder structure:<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Refer :<\/strong> <a href=\"https:\/\/www.youtube.com\/watch?v=9VIiLJL0H4Y\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">ReactJS Tutori<\/span>al - 3 - Folder Structure<\/a><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is await in react?<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>await<\/strong> operator is used to wait for a Promise. It can only be used inside an async function. The keyword <strong>async<\/strong> is <strong>used<\/strong> to make a function <strong>asynchronous<\/strong>. The <strong>await<\/strong> keyword will ask the execution to wait until the defined task gets executed.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Javascript Hoisting:<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Hoisting is the default behaviour of moving all the declarations at the top of the scope before code execution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Ex:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-columns are-vertically-aligned-bottom is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-bottom is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p class=\"wp-block-paragraph\">function catName(name) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;console.log(&#8220;My cat&#8217;s name is &#8221; + name);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">catName(&#8220;Tiger&#8221;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">catName(&#8220;Tiger&#8221;);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">function catName(name) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;console.log(&#8220;My cat&#8217;s name is &#8221; + name);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n<\/div><\/div>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Call function using before or after declaration Does not return any error, because of hoisting<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But, call before function Expression returns error <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>For an example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p class=\"wp-block-paragraph\">catName(&#8220;Tiger&#8221;); \/\/ Returns undefined, as only declaration was hoisted, no initialization has happened at this stage<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let catName = function(name) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;console.log(&#8220;My cat&#8217;s name is &#8221; + name);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n<\/div><\/div>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Var, let and const variables:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">var declarations are globally scoped or function scoped while let and const are block-scoped. var variables can be updated and re-declared within its scope; let variables can be updated but not re-declared; const variables can neither be updated nor re-declared. They are all hoisted to the top of their scope.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Component<\/strong>:<\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>A <strong>Component<\/strong> is one of the core building blocks of React.<\/li><li>In other words, we can say that every application you will develop in React will be made up of pieces called components.<\/li><li>&nbsp;Components make the task of building UIs much easier.&nbsp;<\/li><li>You can see a UI broken down into multiple individual pieces called components and work on them independently and merge them all in a parent component which will be your final UI.&nbsp;<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Functional Components<\/strong>:&nbsp;<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Functional components are simply javascript functions. We can create a functional component in React by writing a javascript function. These functions may or may not receive data as parameters<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ex:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/q4NMq0l0RfDY2RL7VWkaM_PLLa2EYLHDU2Uzu9oao_lElygxcgVd7V_kAUNM-Z6wfS4Rxw8SUqVUPzaDpbHnalAi4_UvYEJQKKkJ3yFNKXlBlgzZqv1nDl9x03cok07ZiUKNPV_E\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Class Components<\/strong>:&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The class components are a little more complex than the functional components. The functional components are not aware of the other components in your program whereas the class components can work with each other. We can pass data from one class component to other class components<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ex:<\/p>\n\n\n\n<figure class=\"wp-block-image wp-duotone-000000-8ed1fc-1\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/5H8VHnriqAqvy9fpi9gFJ6oEg9A_JlN10THxsDFyim17p8mM4kVNWbaR5WZ3-gkmQQrCkCQja50B6SVsFgEOa4LrJOgBCKIfkomitYaQPFDVnnWBzS8kWW-NeS23Gqx1heDaUJ-S\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>The component&#8217;s name must start with an upper case letter<\/li><li>The component has to include the extends React.Component statement, this statement creates an inheritance to React.Component,<\/li><li>The component also requires a render() method, this method returns HTML.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image wp-duotone-1900d8-ffa96b-2\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/pZcXbT1ptrmISQKWVvxZemizRY_khTKOW2g65cLDaeFFRa_CXE6iidSmgYpq3wTFNa8mPvd6nNudXZH5QwS31ycDOCGbya1aZzkjIlRgnbYgme_l-HDV5DTXx1UP3tqkDsPMpDu_\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When you use a constructor function, it should contain super() which executes the parent component&#8217;s constructor function, and your component has access to all the functions of the parent component (React.Component).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Probs:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Short form of Properties<\/li><li>Readonly<\/li><li>Pass parameters to functions<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Ex:<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Class-based probs:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">App.js&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/PcIT1B_mYR_vmSETwG1iiJ1ki4PJ9ixzg6ovTgGFnH3lIRSkEYJUAtM6whbDHhqV4m0ARtPC68rDHC94WFaxbmuEUNvKTFJZI2W7gaDgUcLaP05C3GGWXiBXaVR68S1VT49dZ8PB\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Index.js<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/1O0vIWfEOPSC1OfZfSW9orEF6KI18qFOGQOlHMhk4elQm5YTI6yAHkk2tg_lUBjI_6lEn0CI8WLwmVxEh4v3iJjloyysoZAZKoa_jb88Dp9A8YxfLOP-Jv7Kl14aOqYyTn3upc2E\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">(need to use \u201cthis\u201d before using probs)&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Function-based probs:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">App.js<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/f-YHCnEFw-_CcPj1BjA3VTYp3T69-FBj9zV4GpCdwaFHoh3ckMoCDkhUK9kccPw4z7P19Tr60n-rWayavEsr_JpntBt7aW7C6MkvTyPIzQBZTqYZOjO70sHvyU_Tghgq0HGIJJet\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Index.js<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/1O0vIWfEOPSC1OfZfSW9orEF6KI18qFOGQOlHMhk4elQm5YTI6yAHkk2tg_lUBjI_6lEn0CI8WLwmVxEh4v3iJjloyysoZAZKoa_jb88Dp9A8YxfLOP-Jv7Kl14aOqYyTn3upc2E\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">(pass probs in function)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>State:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">State(local container) is a JavaScript object that stores a component&#8217;s dynamic data and determines the component&#8217;s behaviour. Because the state is dynamic, it enables a component to keep track of changing information in between renders and for it to be dynamic and interactive. The state can only be used within a class component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ex:<\/p>\n\n\n\n<figure class=\"wp-block-image wp-duotone-000000-7f7f7f-3\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/2g058Ay9l9qUV8TEtxP69QD9_terM0yfzAFhMULO-6LxpNUT6Kr03FE5mIf07muWqY6EwmbLZNQ1t9mFR4I98AEm2zYw84uI4pOsyt4iFbGkfAnMaUFEkWU4D_NgQCzEnw_JEyJ9\" alt=\"\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Output:<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/3z3AJOdvAcum6TWs8TF37cE95rxcvtMmRRACDJoDbOiP38TKkvSwYsLfWqfMDtpIet08J7rYcB9r9w266kKBMWD3zAszm2dGI5kwbMCcPqSp76GK1KccTQIpbjbE5GphR_oLK-qT\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Rendering a component:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ex: code in index.js file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">function Welcome(props) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;return &lt;h1&gt;Hello, {props.name}&lt;\/h1&gt;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">const element = &lt;Welcome name=&#8221;Sara&#8221; \/&gt;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ReactDOM.render(element, document.getElementById(&#8216;root&#8217;));<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Save the css with proper syntax:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Execute the command <strong>npm run watch&nbsp; <\/strong>and save the \u201cless file\u201d<strong> <\/strong>, css file will be generated automatically and need to import the css file in app.js to use css<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Component Lifecycle:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Each class component has separate life cycle<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Phases:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Mount<\/strong> (Component created and inserted in DOM)<\/li><li><strong>Update<\/strong> (Undergoes growth by being updated via changes in probs and &nbsp; &nbsp; &nbsp; state)<\/li><li><strong>Unmount<\/strong>(where component is removed fro DOM)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/_PpfekejElEz5wvrO-XoQlsV4n0nppFUNpeShgf6OWaikrFEQIllsVwpau8v9YPE3KSS-fSetjx3wdCAYiUHxKbE4Nm6uoubIJ-nM1WZWlhNc1ooeWWwRVXpZxpstPmiYb7W5MXt\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Order of Execution:<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 1: <\/strong>use Parent component<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Constructor() -&gt; render() -&gt; componentDidMount()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 2:<\/strong> use child component<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Constructor() -&gt; Parent Render() -&gt; Child component render -&gt; Parent componentDidMount()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 3:<\/strong> use child componentDidMount<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Constructor() -&gt; Parent Render() -&gt; Child component render -&gt;Child componentDidMount() -&gt; Parent componentDidMount() &nbsp; &nbsp; ( -&gt;Child component render&nbsp; (This stage occur only when child component contain an continuous execution function like timer))<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 4:<\/strong> use componentWillUnmount()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Constructor() -&gt; Parent Render() -&gt; Child component render -&gt;Child componentDidMount() -&gt; Parent componentDidMount() -&gt;componentWillUnmount()<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">componentWillMount()<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It executes before render(), This method can not be used for the current version<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">componentDidUpdate():<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Handle the operations when users interact (state and probs change)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">componentDidMount():<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Server-side communication can be effectively handled in this phase (call default after constructor execution)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Conclusion:<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In recent days React JS is rapidly gaining its popularity. React JS has become the most accepted Web App Development JavaScript Library.  The <strong>fundamental concepts of React JS<\/strong> will help you understand the initial concepts while you build the web App. You can also read on <a href=\"https:\/\/www.liainfraservices.com\/blog\/how-to-build-a-web-application-like-an-enterprise-based-application\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">How to build a Web Application like an Enterprise based Application<\/span><\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are new to Web Development or looking to develop a Dynamic website with plain old JavaScript or Jquery? <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is your time to <a href=\"https:\/\/www.liainfraservices.com\/web-app-development-company-in-chennai#contact\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">Contact Lia Infraservices<\/span><\/a> &#8211; The Skilled <strong><a href=\"https:\/\/www.liainfraservices.com\/web-app-development-company-in-chennai\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">Web App Development Company in Chennai<\/span><\/a><\/strong>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will look into the fundamental concepts of ReactJS well suitable for beginners. If you are aware of HTML and JavaScript basics then React Native concepts will be easy to work with React Modules and understand different lifecycle methods. At Lia Infraservice we create Dynamic Websites. Become a front-end React JS developer&#8230;<\/p>\n","protected":false},"author":1,"featured_media":979,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"tessera_post_format_link":""},"tesserakbcats":[69],"tesserakbtags":[210,209,211,145,212,79,213,182,142],"class_list":["post-989","tesserakb","type-tesserakb","status-publish","format-standard","has-post-thumbnail","hentry","tesserakbcats-mobile-app-development","tesserakbtags-document-object-model-dom","tesserakbtags-dynamic-website","tesserakbtags-enterprise-application","tesserakbtags-javascript","tesserakbtags-jquery","tesserakbtags-mobile-app-development","tesserakbtags-react-js","tesserakbtags-ui","tesserakbtags-web-app-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fundamental concepts of ReactJS - LIAINFRASERVICES<\/title>\n<meta name=\"description\" content=\"The Fundamental Concept of React JS solves the scalability issue by updating DOM. Contact Lia Infraservices Web App Development Company in Chennai\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fundamental concepts of ReactJS - LIAINFRASERVICES\" \/>\n<meta property=\"og:description\" content=\"The Fundamental Concept of React JS solves the scalability issue by updating DOM. Contact Lia Infraservices Web App Development Company in Chennai\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/\" \/>\n<meta property=\"og:site_name\" content=\"LIAINFRASERVICES\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-12T03:43:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/\",\"url\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/\",\"name\":\"Fundamental concepts of ReactJS - LIAINFRASERVICES\",\"isPartOf\":{\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg\",\"datePublished\":\"2021-11-10T05:05:39+00:00\",\"dateModified\":\"2021-11-12T03:43:26+00:00\",\"description\":\"The Fundamental Concept of React JS solves the scalability issue by updating DOM. Contact Lia Infraservices Web App Development Company in Chennai\",\"breadcrumb\":{\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#primaryimage\",\"url\":\"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg\",\"contentUrl\":\"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg\",\"width\":512,\"height\":315,\"caption\":\"Fundamental Concepts of ReactJS - Lia Infraservices\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.liainfraservices.com\/kbarticles\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Fundamental concepts of ReactJS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/#website\",\"url\":\"https:\/\/www.liainfraservices.com\/kbarticles\/\",\"name\":\"LIAINFRASERVICES\",\"description\":\"committed to the values\",\"publisher\":{\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.liainfraservices.com\/kbarticles\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/#organization\",\"name\":\"LIAINFRASERVICES\",\"url\":\"https:\/\/www.liainfraservices.com\/kbarticles\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/01\/ya.png\",\"contentUrl\":\"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/01\/ya.png\",\"width\":200,\"height\":60,\"caption\":\"LIAINFRASERVICES\"},\"image\":{\"@id\":\"https:\/\/www.liainfraservices.com\/kbarticles\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fundamental concepts of ReactJS - LIAINFRASERVICES","description":"The Fundamental Concept of React JS solves the scalability issue by updating DOM. Contact Lia Infraservices Web App Development Company in Chennai","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/","og_locale":"en_US","og_type":"article","og_title":"Fundamental concepts of ReactJS - LIAINFRASERVICES","og_description":"The Fundamental Concept of React JS solves the scalability issue by updating DOM. Contact Lia Infraservices Web App Development Company in Chennai","og_url":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/","og_site_name":"LIAINFRASERVICES","article_modified_time":"2021-11-12T03:43:26+00:00","og_image":[{"width":512,"height":315,"url":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/","url":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/","name":"Fundamental concepts of ReactJS - LIAINFRASERVICES","isPartOf":{"@id":"https:\/\/www.liainfraservices.com\/kbarticles\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#primaryimage"},"image":{"@id":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#primaryimage"},"thumbnailUrl":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg","datePublished":"2021-11-10T05:05:39+00:00","dateModified":"2021-11-12T03:43:26+00:00","description":"The Fundamental Concept of React JS solves the scalability issue by updating DOM. Contact Lia Infraservices Web App Development Company in Chennai","breadcrumb":{"@id":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#primaryimage","url":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg","contentUrl":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/10\/Fundamental-Concepts-of-ReactJS.jpg","width":512,"height":315,"caption":"Fundamental Concepts of ReactJS - Lia Infraservices"},{"@type":"BreadcrumbList","@id":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/fundamental-concepts-of-reactjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.liainfraservices.com\/kbarticles\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/www.liainfraservices.com\/kbarticles\/knowledgebase\/"},{"@type":"ListItem","position":3,"name":"Fundamental concepts of ReactJS"}]},{"@type":"WebSite","@id":"https:\/\/www.liainfraservices.com\/kbarticles\/#website","url":"https:\/\/www.liainfraservices.com\/kbarticles\/","name":"LIAINFRASERVICES","description":"committed to the values","publisher":{"@id":"https:\/\/www.liainfraservices.com\/kbarticles\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.liainfraservices.com\/kbarticles\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.liainfraservices.com\/kbarticles\/#organization","name":"LIAINFRASERVICES","url":"https:\/\/www.liainfraservices.com\/kbarticles\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.liainfraservices.com\/kbarticles\/#\/schema\/logo\/image\/","url":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/01\/ya.png","contentUrl":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-content\/uploads\/2021\/01\/ya.png","width":200,"height":60,"caption":"LIAINFRASERVICES"},"image":{"@id":"https:\/\/www.liainfraservices.com\/kbarticles\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/tesserakb\/989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/tesserakb"}],"about":[{"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/types\/tesserakb"}],"author":[{"embeddable":true,"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/comments?post=989"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/media\/979"}],"wp:attachment":[{"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/media?parent=989"}],"wp:term":[{"taxonomy":"tesserakbcats","embeddable":true,"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/tesserakbcats?post=989"},{"taxonomy":"tesserakbtags","embeddable":true,"href":"https:\/\/www.liainfraservices.com\/kbarticles\/wp-json\/wp\/v2\/tesserakbtags?post=989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}