SlideShare a Scribd company logo
Fundamental concepts of ReactJS
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 and be a part of our tech-savvy Web App Development
Company in Chennai.
Fundamental Concepts of React JS an Overview?
React is an open-source, front end, JavaScript library used for building User
Interfaces – UI 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 “components”.
Components are independent and reusable. They can either be JavaScript functions
or classes.
The Role of React JS:
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 – “Document Object Model” (DOM) container should be
updated periodically to reflect the changes to the client.
For Example:
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.
React is not a framework. It is just a library developed by Facebook to solve some
problems that we were facing earlier.
Build your React App With Lia Infraservices – Leading Mobile App
Development Company in Chennai.
1. How to Create a Simple React Application?
Open terminal in visual studio code :
Install create-react-app by running this command in your terminal:
C:UsersLIA>npm install -g create-react-app
Run this command to create a React application :
C:UsersLIA>npx create-react-app myfirstreact
Run this command to execute the React application:
C:UsersLIA>npm start
Hello world Example:
Change the code of App.js from src folder
import React, { Component } from ‘react’;
//import ‘./App.css’;
class App extends Component {
render() {
return (
<div className=”App”>
<h1>Hello World!</h1>
</div>
);
}
}
export default App;
Output:
Note: If u did not use
export default App;
It returns an error
2. Folder structure:
Refer : ReactJS Tutorial - 3 - Folder Structure
What is await in react?
The await operator is used to wait for a Promise. It can only be used inside an async
function. The keyword async is used to make a function asynchronous. The await
keyword will ask the execution to wait until the defined task gets executed.
Javascript Hoisting:
Hoisting is the default behaviour of moving all the declarations at the top of the
scope before code execution.
Ex:
function catName(name) {
console.log(“My cat’s name is ” + name);
}
catName(“Tiger”);
Or
catName(“Tiger”);
function catName(name) {
console.log(“My cat’s name is ” + name);
}
Call function using before or after declaration Does not return any error, because of
hoisting
But, call before function Expression returns error
For an example:
catName(“Tiger”); // Returns undefined, as only declaration was hoisted, no initialization
has happened at this stage
Let catName = function(name) {
console.log(“My cat’s name is ” + name);
}
Var, let and const variables:
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.
Component:
● A Component is one of the core building blocks of React.
● In other words, we can say that every application you will develop in React will
be made up of pieces called components.
● Components make the task of building UIs much easier.
● 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.
Functional Components:
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
Ex:
Class Components:
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
Ex:
● The component’s name must start with an upper case letter
● The component has to include the extends React.Component statement, this
statement creates an inheritance to React.Component,
● The component also requires a render() method, this method returns HTML.
When you use a constructor function, it should contain super() which executes the
parent component’s constructor function, and your component has access to all the
functions of the parent component (React.Component).
Probs:
● Short form of Properties
● Readonly
● Pass parameters to functions
Ex:
Class-based probs:
App.js
Index.js
(need to use “this” before using probs)
Function-based probs:
App.js
Index.js
(pass probs in function)
State:
State(local container) is a JavaScript object that stores a component’s dynamic data
and determines the component’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.
Ex:
Output:
Rendering a component:
Ex: code in index.js file
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
const element = <Welcome name=”Sara” />;
ReactDOM.render(element, document.getElementById(‘root’));
Save the css with proper syntax:
Execute the command npm run watch and save the “less file” , css file will be
generated automatically and need to import the css file in app.js to use css
Component Lifecycle:
Each class component has separate life cycle
Phases:
● Mount (Component created and inserted in DOM)
● Update (Undergoes growth by being updated via changes in probs and
state)
● Unmount(where component is removed fro DOM)
Order of Execution:
Case 1: use Parent component
Constructor() -> render() -> componentDidMount()
Case 2: use child component
Constructor() -> Parent Render() -> Child component render -> Parent
componentDidMount()
Case 3: use child componentDidMount
Constructor() -> Parent Render() -> Child component render ->Child
componentDidMount() -> Parent componentDidMount() ( ->Child component
render (This stage occur only when child component contain an continuous
execution function like timer))
Case 4: use componentWillUnmount()
Constructor() -> Parent Render() -> Child component render ->Child
componentDidMount() -> Parent componentDidMount() ->componentWillUnmount()
componentWillMount()
It executes before render(), This method can not be used for the current
version
componentDidUpdate():
Handle the operations when users interact (state and probs change)
componentDidMount():
Server-side communication can be effectively handled in this phase (call default after
constructor execution)
Conclusion:
In recent days React JS is rapidly gaining its popularity. React JS has become the
most accepted Web App Development JavaScript Library. The fundamental concepts
of React JS will help you understand the initial concepts while you build the web
App. You can also read on How to build a Web Application like an Enterprise based
Application.
If you are new to Web Development or looking to develop a Dynamic website with
plain old JavaScript or Jquery?
It is your time to Contact Lia Infraservices – The Skilled Web App Development
Company in Chennai.

More Related Content

What's hot (20)

React js
React jsReact js
React js
Rajesh Kolla
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Knoldus Inc.
 
React-js
React-jsReact-js
React-js
Avi Kedar
 
React JS part 1
React JS part 1React JS part 1
React JS part 1
Diluka Wittahachchige
 
React workshop
React workshopReact workshop
React workshop
Imran Sayed
 
React js
React jsReact js
React js
Alireza Akbari
 
reactJS
reactJSreactJS
reactJS
Syam Santhosh
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
Alessandro Valenti
 
Introduction to react js and reasons to go with react js in 2020
Introduction to react js and reasons to go with react js in 2020Introduction to react js and reasons to go with react js in 2020
Introduction to react js and reasons to go with react js in 2020
Concetto Labs
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
valuebound
 
React js
React jsReact js
React js
Nikhil Karkra
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Rob Quick
 
Reactjs
Reactjs Reactjs
Reactjs
Neha Sharma
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
ReactJs
ReactJsReactJs
ReactJs
Sahana Banerjee
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
Bojan Golubović
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
Ritesh Mehrotra
 
React JS .NET
React JS .NETReact JS .NET
React JS .NET
Jennifer Estrada
 
React js Rahil Memon
React js Rahil MemonReact js Rahil Memon
React js Rahil Memon
RahilMemon5
 

Similar to Fundamental concepts of react js (20)

Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
StephieJohn
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
Fabrit Global
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
Nitin Tyagi
 
React_Complete.pptx
React_Complete.pptxReact_Complete.pptx
React_Complete.pptx
kamalakantas
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
Reactjs
ReactjsReactjs
Reactjs
Mallikarjuna G D
 
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdgunit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
zmulani8
 
Dyanaimcs of business and economics unit 2
Dyanaimcs of business and economics unit 2Dyanaimcs of business and economics unit 2
Dyanaimcs of business and economics unit 2
jpm071712
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
Unit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptxUnit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptx
krishitajariwala72
 
Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"
Flipkart
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
FRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JSFRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
SHAIKIRFAN715544
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
Atlogys Technical Consulting
 
Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !
Ritesh Kumar
 
React JS Workings Exercises Extra Classes
React JS Workings Exercises Extra ClassesReact JS Workings Exercises Extra Classes
React JS Workings Exercises Extra Classes
ssuser426fcf
 
React JS Components & Its Importance.docx
React JS Components & Its Importance.docxReact JS Components & Its Importance.docx
React JS Components & Its Importance.docx
React Masters
 
React Components and Its Importance.docx
React Components and Its Importance.docxReact Components and Its Importance.docx
React Components and Its Importance.docx
React Masters
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
StephieJohn
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
Fabrit Global
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
Nitin Tyagi
 
React_Complete.pptx
React_Complete.pptxReact_Complete.pptx
React_Complete.pptx
kamalakantas
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdgunit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
zmulani8
 
Dyanaimcs of business and economics unit 2
Dyanaimcs of business and economics unit 2Dyanaimcs of business and economics unit 2
Dyanaimcs of business and economics unit 2
jpm071712
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
Unit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptxUnit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptx
krishitajariwala72
 
Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"
Flipkart
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
FRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JSFRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
SHAIKIRFAN715544
 
Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !
Ritesh Kumar
 
React JS Workings Exercises Extra Classes
React JS Workings Exercises Extra ClassesReact JS Workings Exercises Extra Classes
React JS Workings Exercises Extra Classes
ssuser426fcf
 
React JS Components & Its Importance.docx
React JS Components & Its Importance.docxReact JS Components & Its Importance.docx
React JS Components & Its Importance.docx
React Masters
 
React Components and Its Importance.docx
React Components and Its Importance.docxReact Components and Its Importance.docx
React Components and Its Importance.docx
React Masters
 
Ad

More from StephieJohn (6)

Content Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdfContent Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdf
StephieJohn
 
Top 15 Mobile App Design Trends in 2022.pdf
Top 15 Mobile App Design Trends in 2022.pdfTop 15 Mobile App Design Trends in 2022.pdf
Top 15 Mobile App Design Trends in 2022.pdf
StephieJohn
 
Types of Animation in Mobile App Development.pdf
Types of Animation in Mobile App Development.pdfTypes of Animation in Mobile App Development.pdf
Types of Animation in Mobile App Development.pdf
StephieJohn
 
Content Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdfContent Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdf
StephieJohn
 
Comparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdfComparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdf
StephieJohn
 
How to add a new blog post in WordPress.pdf
How to add a new blog post in WordPress.pdfHow to add a new blog post in WordPress.pdf
How to add a new blog post in WordPress.pdf
StephieJohn
 
Content Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdfContent Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdf
StephieJohn
 
Top 15 Mobile App Design Trends in 2022.pdf
Top 15 Mobile App Design Trends in 2022.pdfTop 15 Mobile App Design Trends in 2022.pdf
Top 15 Mobile App Design Trends in 2022.pdf
StephieJohn
 
Types of Animation in Mobile App Development.pdf
Types of Animation in Mobile App Development.pdfTypes of Animation in Mobile App Development.pdf
Types of Animation in Mobile App Development.pdf
StephieJohn
 
Content Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdfContent Writing Tips For Beginners.pdf
Content Writing Tips For Beginners.pdf
StephieJohn
 
Comparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdfComparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdf
StephieJohn
 
How to add a new blog post in WordPress.pdf
How to add a new blog post in WordPress.pdfHow to add a new blog post in WordPress.pdf
How to add a new blog post in WordPress.pdf
StephieJohn
 
Ad

Recently uploaded (20)

Mining Saudi Arabia Monthly Report May 2025
Mining Saudi Arabia Monthly Report May 2025Mining Saudi Arabia Monthly Report May 2025
Mining Saudi Arabia Monthly Report May 2025
Tendayi Mwayi
 
Understanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptx
Understanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptxUnderstanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptx
Understanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptx
Satya Mahesh Kallakuru
 
Oleksandr Osypenko: Професійна етика та відповідальність (UA)
Oleksandr Osypenko: Професійна етика та відповідальність (UA)Oleksandr Osypenko: Професійна етика та відповідальність (UA)
Oleksandr Osypenko: Професійна етика та відповідальність (UA)
Lviv Startup Club
 
Oleksandr Osypenko: Команда проєкту (UA)
Oleksandr Osypenko: Команда проєкту (UA)Oleksandr Osypenko: Команда проєкту (UA)
Oleksandr Osypenko: Команда проєкту (UA)
Lviv Startup Club
 
TriStar Gold Corporate Presentation - June 2025
TriStar Gold Corporate Presentation - June 2025TriStar Gold Corporate Presentation - June 2025
TriStar Gold Corporate Presentation - June 2025
Adnet Communications
 
Cybersecurity for Business Students as a RESOURCE SPEAKER 2021
Cybersecurity for Business Students as a RESOURCE SPEAKER 2021Cybersecurity for Business Students as a RESOURCE SPEAKER 2021
Cybersecurity for Business Students as a RESOURCE SPEAKER 2021
MELJUN CORTES
 
MNC - Simpatico PR B2B PR agency case study 0625.pdf
MNC - Simpatico PR B2B PR agency case study 0625.pdfMNC - Simpatico PR B2B PR agency case study 0625.pdf
MNC - Simpatico PR B2B PR agency case study 0625.pdf
Simpatico PR
 
India’s Role in Supporting Nordic Innovation Through Global Capability Centers
India’s Role in Supporting Nordic Innovation Through Global Capability CentersIndia’s Role in Supporting Nordic Innovation Through Global Capability Centers
India’s Role in Supporting Nordic Innovation Through Global Capability Centers
Inductus GCC
 
How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...
How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...
How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...
mukeshsuryawanshi096
 
Dr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdf
Dr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdfDr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdf
Dr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdf
Dr. Enrique Segura Ense Group
 
1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf
1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf
1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf
TanveerAhmed272451
 
Lundin Gold Corporate Presentation - June 2025
Lundin Gold Corporate Presentation - June 2025Lundin Gold Corporate Presentation - June 2025
Lundin Gold Corporate Presentation - June 2025
Adnet Communications
 
Thermal Energy Investor slide deck - June 2025
Thermal Energy Investor slide deck - June 2025Thermal Energy Investor slide deck - June 2025
Thermal Energy Investor slide deck - June 2025
Marketing847413
 
Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...
Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...
Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...
RaulAmavisca
 
Income tax bill 2025 - income tax india
Income tax bill  2025 - income tax indiaIncome tax bill  2025 - income tax india
Income tax bill 2025 - income tax india
incometaxindia2027
 
Research Proposal for fist three chapter.pdf
Research Proposal for fist three chapter.pdfResearch Proposal for fist three chapter.pdf
Research Proposal for fist three chapter.pdf
moh09152269
 
Business Credit Score​: Why It Is Important & How To Improve It
Business Credit Score​: Why It Is Important & How To Improve ItBusiness Credit Score​: Why It Is Important & How To Improve It
Business Credit Score​: Why It Is Important & How To Improve It
CreditQ1
 
Water Pump Market Size, Share and Forecast | 2025-2034
Water Pump Market Size, Share and Forecast | 2025-2034Water Pump Market Size, Share and Forecast | 2025-2034
Water Pump Market Size, Share and Forecast | 2025-2034
GeorgeButtler
 
KEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdf
KEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdfKEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdf
KEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdf
keycomdata
 
Corporate Wellness Market Share, Size & Growth Report (2025-2034)
Corporate Wellness Market Share, Size & Growth Report (2025-2034)Corporate Wellness Market Share, Size & Growth Report (2025-2034)
Corporate Wellness Market Share, Size & Growth Report (2025-2034)
janewatson684
 
Mining Saudi Arabia Monthly Report May 2025
Mining Saudi Arabia Monthly Report May 2025Mining Saudi Arabia Monthly Report May 2025
Mining Saudi Arabia Monthly Report May 2025
Tendayi Mwayi
 
Understanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptx
Understanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptxUnderstanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptx
Understanding Pharma Revenue Recognition: Accounting Standards: Ind AS15.pptx
Satya Mahesh Kallakuru
 
Oleksandr Osypenko: Професійна етика та відповідальність (UA)
Oleksandr Osypenko: Професійна етика та відповідальність (UA)Oleksandr Osypenko: Професійна етика та відповідальність (UA)
Oleksandr Osypenko: Професійна етика та відповідальність (UA)
Lviv Startup Club
 
Oleksandr Osypenko: Команда проєкту (UA)
Oleksandr Osypenko: Команда проєкту (UA)Oleksandr Osypenko: Команда проєкту (UA)
Oleksandr Osypenko: Команда проєкту (UA)
Lviv Startup Club
 
TriStar Gold Corporate Presentation - June 2025
TriStar Gold Corporate Presentation - June 2025TriStar Gold Corporate Presentation - June 2025
TriStar Gold Corporate Presentation - June 2025
Adnet Communications
 
Cybersecurity for Business Students as a RESOURCE SPEAKER 2021
Cybersecurity for Business Students as a RESOURCE SPEAKER 2021Cybersecurity for Business Students as a RESOURCE SPEAKER 2021
Cybersecurity for Business Students as a RESOURCE SPEAKER 2021
MELJUN CORTES
 
MNC - Simpatico PR B2B PR agency case study 0625.pdf
MNC - Simpatico PR B2B PR agency case study 0625.pdfMNC - Simpatico PR B2B PR agency case study 0625.pdf
MNC - Simpatico PR B2B PR agency case study 0625.pdf
Simpatico PR
 
India’s Role in Supporting Nordic Innovation Through Global Capability Centers
India’s Role in Supporting Nordic Innovation Through Global Capability CentersIndia’s Role in Supporting Nordic Innovation Through Global Capability Centers
India’s Role in Supporting Nordic Innovation Through Global Capability Centers
Inductus GCC
 
How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...
How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...
How Mukesh Suryawanshi is Revolutionizing India’s Spice Industry: A Journey o...
mukeshsuryawanshi096
 
Dr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdf
Dr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdfDr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdf
Dr. Enrique Segura Ense Group - A Collector Of Italian Cars.pdf
Dr. Enrique Segura Ense Group
 
1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf
1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf
1ɓbbbbbbbbbbbbbbbbbbbbbbbbbb. UCP600.pdf
TanveerAhmed272451
 
Lundin Gold Corporate Presentation - June 2025
Lundin Gold Corporate Presentation - June 2025Lundin Gold Corporate Presentation - June 2025
Lundin Gold Corporate Presentation - June 2025
Adnet Communications
 
Thermal Energy Investor slide deck - June 2025
Thermal Energy Investor slide deck - June 2025Thermal Energy Investor slide deck - June 2025
Thermal Energy Investor slide deck - June 2025
Marketing847413
 
Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...
Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...
Vision, Mission, Purpose & Core Values: Leading with Clarity in a Time-Boxed ...
RaulAmavisca
 
Income tax bill 2025 - income tax india
Income tax bill  2025 - income tax indiaIncome tax bill  2025 - income tax india
Income tax bill 2025 - income tax india
incometaxindia2027
 
Research Proposal for fist three chapter.pdf
Research Proposal for fist three chapter.pdfResearch Proposal for fist three chapter.pdf
Research Proposal for fist three chapter.pdf
moh09152269
 
Business Credit Score​: Why It Is Important & How To Improve It
Business Credit Score​: Why It Is Important & How To Improve ItBusiness Credit Score​: Why It Is Important & How To Improve It
Business Credit Score​: Why It Is Important & How To Improve It
CreditQ1
 
Water Pump Market Size, Share and Forecast | 2025-2034
Water Pump Market Size, Share and Forecast | 2025-2034Water Pump Market Size, Share and Forecast | 2025-2034
Water Pump Market Size, Share and Forecast | 2025-2034
GeorgeButtler
 
KEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdf
KEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdfKEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdf
KEY COMMUNICATIONS CREDENTIALS 2025 Brand VN.pdf
keycomdata
 
Corporate Wellness Market Share, Size & Growth Report (2025-2034)
Corporate Wellness Market Share, Size & Growth Report (2025-2034)Corporate Wellness Market Share, Size & Growth Report (2025-2034)
Corporate Wellness Market Share, Size & Growth Report (2025-2034)
janewatson684
 

Fundamental concepts of react js

  • 1. Fundamental concepts of ReactJS 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 and be a part of our tech-savvy Web App Development Company in Chennai. Fundamental Concepts of React JS an Overview? React is an open-source, front end, JavaScript library used for building User Interfaces – UI components. It is initially developed by Facebook for a purpose and
  • 2. maintained by a community of individual developers and companies. It breaks down complex UIs into small, isolated code called “components”. Components are independent and reusable. They can either be JavaScript functions or classes. The Role of React JS: 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 – “Document Object Model” (DOM) container should be updated periodically to reflect the changes to the client. For Example: 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. React is not a framework. It is just a library developed by Facebook to solve some problems that we were facing earlier. Build your React App With Lia Infraservices – Leading Mobile App Development Company in Chennai. 1. How to Create a Simple React Application? Open terminal in visual studio code : Install create-react-app by running this command in your terminal: C:UsersLIA>npm install -g create-react-app Run this command to create a React application :
  • 3. C:UsersLIA>npx create-react-app myfirstreact Run this command to execute the React application: C:UsersLIA>npm start Hello world Example: Change the code of App.js from src folder
  • 4. import React, { Component } from ‘react’; //import ‘./App.css’; class App extends Component { render() { return ( <div className=”App”> <h1>Hello World!</h1> </div> ); } } export default App; Output:
  • 5. Note: If u did not use export default App; It returns an error 2. Folder structure: Refer : ReactJS Tutorial - 3 - Folder Structure What is await in react? The await operator is used to wait for a Promise. It can only be used inside an async function. The keyword async is used to make a function asynchronous. The await keyword will ask the execution to wait until the defined task gets executed. Javascript Hoisting: Hoisting is the default behaviour of moving all the declarations at the top of the scope before code execution. Ex: function catName(name) {
  • 6. console.log(“My cat’s name is ” + name); } catName(“Tiger”); Or catName(“Tiger”); function catName(name) { console.log(“My cat’s name is ” + name); } Call function using before or after declaration Does not return any error, because of hoisting But, call before function Expression returns error For an example: catName(“Tiger”); // Returns undefined, as only declaration was hoisted, no initialization has happened at this stage Let catName = function(name) {
  • 7. console.log(“My cat’s name is ” + name); } Var, let and const variables: 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. Component: ● A Component is one of the core building blocks of React. ● In other words, we can say that every application you will develop in React will be made up of pieces called components. ● Components make the task of building UIs much easier. ● 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. Functional Components: 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 Ex: Class Components:
  • 8. 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 Ex: ● The component’s name must start with an upper case letter ● The component has to include the extends React.Component statement, this statement creates an inheritance to React.Component, ● The component also requires a render() method, this method returns HTML. When you use a constructor function, it should contain super() which executes the parent component’s constructor function, and your component has access to all the functions of the parent component (React.Component).
  • 9. Probs: ● Short form of Properties ● Readonly ● Pass parameters to functions Ex: Class-based probs: App.js Index.js (need to use “this” before using probs) Function-based probs: App.js
  • 10. Index.js (pass probs in function) State: State(local container) is a JavaScript object that stores a component’s dynamic data and determines the component’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. Ex:
  • 11. Output: Rendering a component: Ex: code in index.js file function Welcome(props) { return <h1>Hello, {props.name}</h1>;
  • 12. } const element = <Welcome name=”Sara” />; ReactDOM.render(element, document.getElementById(‘root’)); Save the css with proper syntax: Execute the command npm run watch and save the “less file” , css file will be generated automatically and need to import the css file in app.js to use css Component Lifecycle: Each class component has separate life cycle Phases: ● Mount (Component created and inserted in DOM) ● Update (Undergoes growth by being updated via changes in probs and state) ● Unmount(where component is removed fro DOM) Order of Execution: Case 1: use Parent component
  • 13. Constructor() -> render() -> componentDidMount() Case 2: use child component Constructor() -> Parent Render() -> Child component render -> Parent componentDidMount() Case 3: use child componentDidMount Constructor() -> Parent Render() -> Child component render ->Child componentDidMount() -> Parent componentDidMount() ( ->Child component render (This stage occur only when child component contain an continuous execution function like timer)) Case 4: use componentWillUnmount() Constructor() -> Parent Render() -> Child component render ->Child componentDidMount() -> Parent componentDidMount() ->componentWillUnmount() componentWillMount() It executes before render(), This method can not be used for the current version componentDidUpdate(): Handle the operations when users interact (state and probs change) componentDidMount():
  • 14. Server-side communication can be effectively handled in this phase (call default after constructor execution) Conclusion: In recent days React JS is rapidly gaining its popularity. React JS has become the most accepted Web App Development JavaScript Library. The fundamental concepts of React JS will help you understand the initial concepts while you build the web App. You can also read on How to build a Web Application like an Enterprise based Application. If you are new to Web Development or looking to develop a Dynamic website with plain old JavaScript or Jquery? It is your time to Contact Lia Infraservices – The Skilled Web App Development Company in Chennai.