0% found this document useful (0 votes)
3 views9 pages

React Js Interview Questions and Answers

The document provides an overview of React.js, including its definition, features, and key concepts such as JSX, Virtual DOM, Flux, Redux, and components. It also covers important aspects like state management, props, synthetic events, and the use of tools like Webpack and Babel. Additionally, it addresses common issues with MVC architecture in React and explains various terms related to React development.

Uploaded by

maheshwork019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views9 pages

React Js Interview Questions and Answers

The document provides an overview of React.js, including its definition, features, and key concepts such as JSX, Virtual DOM, Flux, Redux, and components. It also covers important aspects like state management, props, synthetic events, and the use of tools like Webpack and Babel. Additionally, it addresses common issues with MVC architecture in React and explains various terms related to React development.

Uploaded by

maheshwork019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Created by:-Lalit Ingale

REACT
1)What is Reactjs?
➔React is a JavaScript library that makes building user interfaces easy. It
was developed by Facebook.

2)Does React use HTML?


➔No, It uses JSX, which is similar to HTML.

3)When was React first released?


➔React was first released on March 2013.

4)Give me two most significant drawbacks of React.



• Integrating React with the MVC framework like Rails requires complex
configuration.
• React require the users to have knowledge about the integration of
user interface into MVC framework.

5)State the difference between Real DOM and Virtual DOM.


➔-Difference as follows.

REAL DOM VIRTUAL DOM


1)It is updated 1)It updates faster.
slowly.

2)It allows a direct update from HTML.


2)It cannot be used to update HTML
directly.
Created by:-Lalit Ingale

3)It wastes too much memory. 3)Memory consumption is less.

6)What is Flux Concept in React?


➔Flux is a pattern used in React to manage data flow in one direction,
making it easier to handle and update data in large applications.

7)Define the term Redux in React.


➔Redux is a library used for front end development. It is a state container
for JavaScript applications which should be used for the applications state
management. You can test and run an application developed with Redux in
different environments.

8)What is the 'Store' feature in Redux?


➔Redux has a feature called 'Store' which allows you to save the
application's entire State at one place. Therefore all it's component's State
are stored in the Store so that you will get regular updates directly from the
Store. The single state tree helps you to keep track of changes over time
and debug or inspect the application.

9)What is an action in Redux?


➔It is a function which returns an action object. The action-type and the
action data are always stored in the action object. Actions can send data
between the Store and the software application. All information retrieved
by the Store is produced by the actions.

10)Name the important features of React.


➔i) Allows you to use 3rd party libraries
ii) Time-Saving
iii) Faster Development
iv) Simplicity and Composable
Created by:-Lalit Ingale

v) Fully supported by Facebook


vi) Code Stability with One-directional data
binding React Components

11)Explain the term stateless components.


➔ A stateless component in React is a component that does not manage
any state and only displays data passed to it using props.

12)Explain React Router.


➔ React Router is a library that allows you to create and navigate between
multiple pages in a React app without reloading the whole page.

13)What is dispatcher?
➔ In Flux architecture, a dispatcher is a middleman that sends actions
(events) to the appropriate store.

14) What is meant by callback function? What is its purpose?


➔ A callback function in React is a function passed as a prop to a child
component, which the child calls to communicate or send data back to the
parent component or trigger an action after some event (like a button
click).

15) Explain the term high order component.


➔ A higher-order component also shortly known as HOC is an advanced
technique for reusing component logic. It is not a part of the React API, but
they are a pattern which emerges from React compositional nature.

16) Explain the Presentational segment.


➔ A presentational segment in React is a component that only shows UI
based on the data (props) it receives and does not manage or change any
data itself.
Created by:-Lalit Ingale

17) What are Props in react js?


➔ Props mean properties, which is a way of passing data from parent to
child. We can say that props are just a communication channel between
components. It is always moving from parent to child component.

18) Explain yield catchphrase in JavaScript.


➔ The yield catchphrase is utilized to delay and resume a generator work,
which is known as yield catchphrase.

19)Name two types of React component.


➔i)Function Component
ii)Class Component

20)Explain synthetic event in React js.


➔ Synthetic event is a kind of object which acts as a cross-browser
wrapper around the browser’s native event. It also helps us to combine the
behaviours of various browser into signal API.

21)What is React State?


➔ It is an object which decides how a specific component renders and how
it behaves. The state stores the information which can be changed over the
lifetime of a React component.

22)How can you update state in react js?


➔ A state can be updated on the component directly or indirectly.

23) Explain the use of the arrow function in React.


➔ The arrow function helps you to predict the behaviour of bugs when
passed as a callback. Therefore, it prevents bug caused by this all together.

24)State the main difference between Pros and State.


Created by:-Lalit Ingale

➔ The main difference the two is that the State is mutable and Pros are
immutable.

25)Explain pure components in React js.


➔ Pure components are the fastest components which can replace any
component with only a render(). It helps you to enhance the simplicity of
the code and performance of the application.

26)What kind of information controls a segment in React?


➔- There are mainly two sorts of information that control a segment: State
and Props.
i) State: State information that will change, we need to utilize State.
ii) Props: Props are set by the parent and which are settled all through the
lifetime of a part.

27)What is 'create-react-app'?
➔ 'create-react-app' is a command-line tool which allows you to create
one basic react application.

28)Explain the use of 'key' in react list.


➔ Keys allow you to provide each list element with a stable identity. The
keys should be unique.

29)What are children prop?


➔ Children props are used to pass component to other components as
properties.

30) Explain error boundaries?


➔ Error Boundaries are special React components that catch JavaScript
errors anywhere in their child component tree and show a fallback UI
instead of breaking the whole app.
Created by:-Lalit Ingale

31) What is the use of empty tags ?


➔ Empty tags <> </> let you group multiple React elements together
without creating extra HTML elements in the browser.

32)Explain strict mode.


➔ StrictMode allows you to run checks and warnings for react
components. It runs only on development build. It helps you to highlight
the issues without rendering any visible UI.

33)What are reacted portals?


➔ Portal allows you to render children into a DOM node. CreatePortal
method is used for it.

34)What is Context?
➔ React context helps you to pass data using the tree of react
components. It helps you to share data globally between various react
components.

35)What is the use of Webpack?


➔ Webpack is a tool that helps bundle all your React project files
(JavaScript, CSS, images, etc.) into one or more files that the browser can
understand and load.

36)What is Babel in React js?


➔ Babel, is a JavaScript compiler that converts latest JavaScript like ES6,
ES7 into plain old ES5 JavaScript that most browsers understand.

37)How can a browser read JSX file?


➔ If you want the browser to read JSX, then that JSX file should be
replaced using a JSX transformer like Babel and then send back to the
browser.
Created by:-Lalit Ingale

38)What are the major issues of using MVC architecture in React?


➔i)DOM handling is quite expensive
ii)Most of the time applications were slow and
inefficient
iii)Because of circular functions, a complex model has been created
around models and ideas

39)What can be done when there is more than one line of expression?
➔ At that time a multi-line JSX expression is the only option left for you.

40)What is the reduction?


➔ The reduction is an application method of handling State.

41)Explain the term synthetic events.


➔ It is actually a cross-browser wrapper around the browser’s native
event. These events have interface stopPropagation() and preventDefault().

42)When should you use the top-class elements for the function element?
➔ If your element does a stage or lifetime cycle, we should use top-class
elements.

43)How can you share an element in the parsing?


➔Using the State, we can share the data.

44)Explain the term reconciliation.


➔ Reconciliation is the process React uses to compare the old UI with the
new UI and then update only the parts that changed — instead of reloading
the whole page.

45)How can you re-render a component without using setState()


function?
Created by:-Lalit Ingale

➔ You can use forceUpdate() function for re-rending any component.

46)Can you update props in react?


➔ You can’t update props in react js because props are read-only.
Moreover, you can not modify props received from parent to child.

47)Explain the term 'Restructuring.'


➔ Restructuring is extraction process of array objects. Once the process is
completed, you can separate each object in a separate variable.

48)Can you update the values of props?


➔ It is not possible to update the value of props as it is immutable.

49)Explain the meaning of Mounting and Demounting.


➔i)The process of attaching the element to the DCOM is called mounting.
ii)The process of detaching the element from the DCOM is called the
demounting process.

50)What is the use of ‘props-types’ liberary?


➔ 'Prop-types' library allows you to perform runtime type checking for
props and similar object in a recent application.
Created by:-Lalit Ingale

THANK
YOU

You might also like