Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

react
es6
javascript

What is React JS?

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Answers Code

React JS is an open-source JavaScript library for building user interfaces – usually for single-page and mobile applications.

A user interface in React is built around components. Each of these components is a Javascript function defined by the user.

These components optionally accept inputs, i.e. props (properties), and return React elements that describe exactly how a section of the UI (user interface) should appear accordingly.

React applications are usually built around a single HTML element, often called the root node.

svg viewer

Since React elements are immutable (cannot be changed), the only way to “change” an element is to render a new one on the screen. React maintains a Virtual DOM which records all these element changes.

Elements are rendered on the screen by calling the ReactDOM.render() method which compares the real and virtual DOM elements, making as few changes as possible. The ReactDOM always attemps to avoid reloading the whole page in this diffing process, as shown below:

svg viewer

RELATED TAGS

react
es6
javascript
Copyright ©2022 Educative, Inc. All rights reserved