ReactJS Interview Questions and Answers

What is React

ReactJs is an open-source frontend javascript library that is used to build user interfaces and handle view layers for web and mobile applications.

it follows a component-based approach. Tha react package contains only the functionility necessary to define React components.

it is typically used together with a React renderer like react-DOM for the web or react-native for the native envirnment.

What are the features of ReactJS?

Virtual DOM,

Server-side rendering

Uni-directional data flow or data binding

List some of the major advantages of React\

Increase the performance of the applications

Easy to integrate

Easy to write UI test cases

Can be used on the client as well as server-side

What is JSX

JSX stands for JavascriptXML

Utilizes the expressiveness of JavaScript With an HTML-Like template syntax.

Boosts up the JS Performance

What do you understand by virtual DOM? Explain its working

A virtual DOM is a lightweight JavaScript object which is a copy of the real DOM.

This Virtual DOM works in simple steps

  1. Whenever any underlying data changes. the entire UI is re-rendered in virtual DOM representation.
  2. Then the difference between the previous DOM representation and the new one is calculated.
  3. Once the calculations are done, the real DOM will be updated with only the things that have actually changed
Difference VM and RM

How did React syntax change from ES5 to ES6?

ES5 coding state
ES6 coding state

What are the features introduced in ES7?

ECMAScript 2016 introduced two new features.

  1. Array.prototype.include():- it checks the array for the value passed as an argument. it returns true if the array contains the value, otherwise. it returns false.
  2. Exponentiation Operator: ECMAScript 2016 introduced the exponentiation operator, **. it has the same purpose as Math. pow().

How can you update the state of components?

What do you mean by Event Pooling?

This means that the SystheticEvent object would be reused and all propertiec would be nullified after the event handler has been called. For example, earlier this would not work:

This would not work because the event object gets reused
Prevent React from resetting its properties,hence would work.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store