SlideShare a Scribd company logo
Welcome To Ducat India
70-70-90-50-90
www.tutorials.ducatindia.com
Q1). Advantages of React JS in 2022 with its
Limitation
 React JS is open source platform as well as SEO friendly. It is used by both Innovative
Startups and Fortune 500 Companies. Sites using React JS are Netflix, Dropbox,
Dailymotion, American Express, GoDaddy, Coursera, BBC, MDB, Mochi-Pet
Supplies and Food, NewYork Times etc.
 To know more about advantages we can define React JS in few words i.e. Advanced,
Non-Risky, Responsive or as Follows-
1. Abstract and Encapsulation of code.
2. Increase speed by importing feature with synchronized UI System.
3. Don’t need to write whole scripting code. Just need to write the state and declare its
Q2). Role of Virtual-DOM and how it effects
with React JS
Document object model contain record of scripts and when it comes
with react JS it can be called as Virtual DOM or React DOM. React
DOM is actually the virtual copy of Actual DOM which is created when
you modify or update using React and React then make changes to
Actual DOM by creating its Virtual DOM. It’s quite expensive because
browser take time to calculate CSS, all margins, Layouts, JSS modifying
queries etc. As it’s expensive to make changes in Actual DOM so React
created its Virtual DOM as copy and make changes in it and then later
changes in Actual DOM will made.
Q3). What do you meant by Import and
Export in React and writes its Syntax.
It’s very Important and main feature in React which makes it more
useful and make process faster. Importing Files meant to be calling
data from other files easily by giving export access to files. When we
use different components in code, Import and Export helps to
communicate with different code files of components.
Q4). How Classes or Class components are
created in React, Explanation and its Syntax?
React JS create class components with and without ES6. When you
create classes without ES6 then following syntax is used-:
Var create React Class = require (‘create-react-class’);
Var Greeting = create React Class({
Render: function () {
Return < h1>Hello,
{this.props.name}</ h1>;
}
});
Moreover, with create React Class(), you have to provide separate
get Initial State method that returns initial state:
Q5). Different Types of Components in react
IN REACT JS CONTAIN TWO TYPES OF COMPONENTS
1.Stateless Functional Components
These are JavaScript Function as-:
Function welcome(props) {
Return < h1>Hello, {props.name}</ h1>; }
2.Stateful Class Component
These are components having ES6 or regular classes that extend
component class from react library. It must contain Render method
returning HTML
Class welcome extends React.Component (
render() {
return < h1> Hello, {this.props.name} </ h1>;
}
)
Q6). State v/s Props in React?
React make it easy to manage the data and rendering of data when
data changes. Two main ways to think about data in react is states and
props.
Props are useful in passing the arguments to the components we are
creating. It handles components outside updating for example-
increment and decrement of counter Component. As when we create a
class and its constructor so to pass constructor to a class props declare
differently. It’s mostly used for static activities.
State
State is about to handle inside process of the component. State is
mainly used to handle update storing activity and rendering of
component of what user has been done. It is used for dynamic
activities.
Q7). Which Middleware or Function used to
handle asynchronous dispatching of actions?
Redux Reducer is used to handle asynchronous dispatching. Mainly
three things are there to be noted in code i.e. state, actions and reducer.
Const redux = require(‘redux’)
Const create Store = redux.createstore
Const initial State = {
Loading: false,
Users: [],
Error: ‘’
}
CONST FETCH_USERS_REQUEST =
‘FETCH_USERS_REQUEST’
Const FETCH_USERS_SUCCESS =
‘FETCH_USERS_SUCCESS’
Q8). Explain Pure Component?
Pure components compare old states and objects to new states and
objects to decide that re-rendering should happen or not for updating.
If old states and objects are same with new code then pure component
in react don’t allow re-rendering of functions. So, if we extend class
component with pure component then there is no need to apply should
Component Update () lifecycle method. It is helpful in making
application faster while in case of regular components, it will always
re-render either value of states and props changes or not.
Q9). Explain Commands as follows-:
Following are the commands:-
Set State()-:
It is a command in react which set the schedule for updation like clock
components etc. and triggers when updation needed and set to
rendering of code of the page.
Render()-:
When we create application Code written in components that will
translated into elements that get mounted into DOM. React application
splits into two phases that is render phase and commit phase. When
traversing is done, while creating the elements Create element () is
used and then works on DOM will start after creating and go to
Commit phase.
Q10). Explain use of React Component API-
find DOM Node method?
For DOM manipulation ‘find DOM Node’ method is used. Before we
apply this we have to declare object in body as -:
To Know More, Visit Our Website
< button onClick=(this.findDOMNodeHandler)> Find
DOM Node </ button>
< div id=”myDiv”>Dom Node </ div>
findDOMNodeHandler= () => {
let myDiv = document.getElementById(“myDiv”)
ReactDOM.findDOMNode(myDiv).style.color=”green”
}
Ad

More Related Content

Similar to Interview Questions On React JS.pptx (20)

React
ReactReact
React
manii kanta
 
ReactJS (1)
ReactJS (1)ReactJS (1)
ReactJS (1)
George Tony
 
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
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
Sergio Nakamura
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
dhanushkacnd
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
React js
React jsReact js
React js
Rajesh Kolla
 
Intro react js
Intro react jsIntro react js
Intro react js
Vijayakanth MP
 
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
 
What are the components in React?
What are the components in React?What are the components in React?
What are the components in React?
BOSC Tech Labs
 
How to create components in react js
How to create components in react jsHow to create components in react js
How to create components in react js
BOSC Tech Labs
 
Materi Modern React Redux Power Point.pdf
Materi Modern React Redux Power Point.pdfMateri Modern React Redux Power Point.pdf
Materi Modern React Redux Power Point.pdf
exiabreak
 
React JS Interview Questions PDF By ScholarHat
React JS Interview Questions PDF By ScholarHatReact JS Interview Questions PDF By ScholarHat
React JS Interview Questions PDF By ScholarHat
Scholarhat
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
Introduction to react and redux
Introduction to react and reduxIntroduction to react and redux
Introduction to react and redux
Cuong Ho
 
How Owl.js Masterfully Blends React and Vue Awesomeness in odoo
How Owl.js Masterfully Blends React and Vue Awesomeness in odooHow Owl.js Masterfully Blends React and Vue Awesomeness in odoo
How Owl.js Masterfully Blends React and Vue Awesomeness in odoo
Celine George
 
REACT pdf.docx
REACT pdf.docxREACT pdf.docx
REACT pdf.docx
PSK Technolgies Pvt. Ltd. IT Company Nagpur
 
React JS Interview Question & Answer
React JS Interview Question & AnswerReact JS Interview Question & Answer
React JS Interview Question & Answer
Mildain Solutions
 
A full introductory guide to React
A full introductory guide to ReactA full introductory guide to React
A full introductory guide to React
Jean Carlo Emer
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR3
 
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
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
Sergio Nakamura
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
dhanushkacnd
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
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
 
What are the components in React?
What are the components in React?What are the components in React?
What are the components in React?
BOSC Tech Labs
 
How to create components in react js
How to create components in react jsHow to create components in react js
How to create components in react js
BOSC Tech Labs
 
Materi Modern React Redux Power Point.pdf
Materi Modern React Redux Power Point.pdfMateri Modern React Redux Power Point.pdf
Materi Modern React Redux Power Point.pdf
exiabreak
 
React JS Interview Questions PDF By ScholarHat
React JS Interview Questions PDF By ScholarHatReact JS Interview Questions PDF By ScholarHat
React JS Interview Questions PDF By ScholarHat
Scholarhat
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHatReact Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
Introduction to react and redux
Introduction to react and reduxIntroduction to react and redux
Introduction to react and redux
Cuong Ho
 
How Owl.js Masterfully Blends React and Vue Awesomeness in odoo
How Owl.js Masterfully Blends React and Vue Awesomeness in odooHow Owl.js Masterfully Blends React and Vue Awesomeness in odoo
How Owl.js Masterfully Blends React and Vue Awesomeness in odoo
Celine George
 
React JS Interview Question & Answer
React JS Interview Question & AnswerReact JS Interview Question & Answer
React JS Interview Question & Answer
Mildain Solutions
 
A full introductory guide to React
A full introductory guide to ReactA full introductory guide to React
A full introductory guide to React
Jean Carlo Emer
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR3
 

Recently uploaded (20)

SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Ad

Interview Questions On React JS.pptx

  • 1. Welcome To Ducat India 70-70-90-50-90 www.tutorials.ducatindia.com
  • 2. Q1). Advantages of React JS in 2022 with its Limitation  React JS is open source platform as well as SEO friendly. It is used by both Innovative Startups and Fortune 500 Companies. Sites using React JS are Netflix, Dropbox, Dailymotion, American Express, GoDaddy, Coursera, BBC, MDB, Mochi-Pet Supplies and Food, NewYork Times etc.  To know more about advantages we can define React JS in few words i.e. Advanced, Non-Risky, Responsive or as Follows- 1. Abstract and Encapsulation of code. 2. Increase speed by importing feature with synchronized UI System. 3. Don’t need to write whole scripting code. Just need to write the state and declare its
  • 3. Q2). Role of Virtual-DOM and how it effects with React JS Document object model contain record of scripts and when it comes with react JS it can be called as Virtual DOM or React DOM. React DOM is actually the virtual copy of Actual DOM which is created when you modify or update using React and React then make changes to Actual DOM by creating its Virtual DOM. It’s quite expensive because browser take time to calculate CSS, all margins, Layouts, JSS modifying queries etc. As it’s expensive to make changes in Actual DOM so React created its Virtual DOM as copy and make changes in it and then later changes in Actual DOM will made.
  • 4. Q3). What do you meant by Import and Export in React and writes its Syntax. It’s very Important and main feature in React which makes it more useful and make process faster. Importing Files meant to be calling data from other files easily by giving export access to files. When we use different components in code, Import and Export helps to communicate with different code files of components.
  • 5. Q4). How Classes or Class components are created in React, Explanation and its Syntax? React JS create class components with and without ES6. When you create classes without ES6 then following syntax is used-: Var create React Class = require (‘create-react-class’); Var Greeting = create React Class({ Render: function () { Return < h1>Hello, {this.props.name}</ h1>; } }); Moreover, with create React Class(), you have to provide separate get Initial State method that returns initial state:
  • 6. Q5). Different Types of Components in react IN REACT JS CONTAIN TWO TYPES OF COMPONENTS 1.Stateless Functional Components These are JavaScript Function as-: Function welcome(props) { Return < h1>Hello, {props.name}</ h1>; } 2.Stateful Class Component These are components having ES6 or regular classes that extend component class from react library. It must contain Render method returning HTML Class welcome extends React.Component ( render() { return < h1> Hello, {this.props.name} </ h1>; } )
  • 7. Q6). State v/s Props in React? React make it easy to manage the data and rendering of data when data changes. Two main ways to think about data in react is states and props. Props are useful in passing the arguments to the components we are creating. It handles components outside updating for example- increment and decrement of counter Component. As when we create a class and its constructor so to pass constructor to a class props declare differently. It’s mostly used for static activities. State State is about to handle inside process of the component. State is mainly used to handle update storing activity and rendering of component of what user has been done. It is used for dynamic activities.
  • 8. Q7). Which Middleware or Function used to handle asynchronous dispatching of actions? Redux Reducer is used to handle asynchronous dispatching. Mainly three things are there to be noted in code i.e. state, actions and reducer. Const redux = require(‘redux’) Const create Store = redux.createstore Const initial State = { Loading: false, Users: [], Error: ‘’ } CONST FETCH_USERS_REQUEST = ‘FETCH_USERS_REQUEST’ Const FETCH_USERS_SUCCESS = ‘FETCH_USERS_SUCCESS’
  • 9. Q8). Explain Pure Component? Pure components compare old states and objects to new states and objects to decide that re-rendering should happen or not for updating. If old states and objects are same with new code then pure component in react don’t allow re-rendering of functions. So, if we extend class component with pure component then there is no need to apply should Component Update () lifecycle method. It is helpful in making application faster while in case of regular components, it will always re-render either value of states and props changes or not.
  • 10. Q9). Explain Commands as follows-: Following are the commands:- Set State()-: It is a command in react which set the schedule for updation like clock components etc. and triggers when updation needed and set to rendering of code of the page. Render()-: When we create application Code written in components that will translated into elements that get mounted into DOM. React application splits into two phases that is render phase and commit phase. When traversing is done, while creating the elements Create element () is used and then works on DOM will start after creating and go to Commit phase.
  • 11. Q10). Explain use of React Component API- find DOM Node method? For DOM manipulation ‘find DOM Node’ method is used. Before we apply this we have to declare object in body as -: To Know More, Visit Our Website < button onClick=(this.findDOMNodeHandler)> Find DOM Node </ button> < div id=”myDiv”>Dom Node </ div> findDOMNodeHandler= () => { let myDiv = document.getElementById(“myDiv”) ReactDOM.findDOMNode(myDiv).style.color=”green” }