Trusted answers to developer questions

What is React JS?

Get Started With Data Science

Learn the fundamentals of Data Science with this free course. Future-proof your career by adding Data Science skills to your toolkit — or prepare to land a job in AI, Machine Learning, or Data Analysis.

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 ©2024 Educative, Inc. All rights reserved
Did you find this helpful?