DEV Community

Cover image for Top 6 Features in React
Brayan Kai
Brayan Kai

Posted on • Updated on

Top 6 Features in React

What is React

Let us start first by getting to know what React is.

React is a JavaScript library for creating user interfaces that is declarative, efficient, and customizable.

Let's take a look at React, its history, and some of its basic concepts.

React was conceived at Facebook and, with the exception of a minor snag in 2017 over license restrictions, has seen steady growth since its launch. React may be the most popular JavaScript framework nowadays, depending on whose statistics you look at.

Here is just but a few reasons why people chose to program with React:

  • React is lightning fast. React apps can handle complicated updates while still feeling fast and responsive.

  • React is modular. You can write several smaller, reusable files instead of massive, dense code files. The modularity of React can be a lovely answer to JavaScript's maintainability issues.

  • React is a scalable framework. React works best in large projects that display a lot of changing data.

  • React is adaptable. You can use React for a variety of projects that aren't related to building a web app. React's potential is still being discovered. There's a lot to discover.

  • React is a popular framework. While this rationale has little to do with React's quality, it is true that knowing React will increase your employability.

Let's now delve in into the features of React:

We are going to look into the following top features of react:

  1. JSX

  2. Components

  3. One-way Data Binding

  4. Virtual DOM

  5. Simplicity

  6. Performance

So Lets get right into it

JSX

JavaScript XML is abbreviated as JSX. It's a syntax extension for JavaScript. Its an XML or HTML like syntax used by ReactJS. This syntax is converted into React Framework JavaScript calls. It enhances ES6 to allow HTML-like text and JavaScript react code to coexist. It is not required to utilize JSX, however it is strongly recommended in ReactJS.
Because JSX isn't supported by browsers, the Babel compiler converts the code to JavaScript.

JSX is one of the best features of React JS as it makes it super easy for developers to write the building blocks

Components
Components are at the heart of ReactJS. A ReactJS application consists of several components, each with its own logic and controls. These components are reusable, which makes it easier to keep track of the code when working on larger projects.

One-way Data Binding
ReactJS is built to follow unidirectional data flow, often known as one-way data binding. The advantages of one-way data binding provide you more control over the application as a whole. If the data flow occurs in the opposite way, additional characteristics are required. Because components are designed to be immutable, and the data they contain cannot be modified, this is the case. Flux is a pattern that aids in data unidirectionality. As a result, the application becomes more versatile, resulting in increased efficiency.

Virtual DOM
The original DOM object is represented by a virtual DOM object. It functions similarly to a one-way data binding. The complete UI is re-rendered in virtual DOM representation whenever any changes are made to the web application. Then it compares the old DOM representation to the new DOM representation. After that, the true DOM will only update the elements that have actually changed. This speeds up the application and eliminates memory waste.

Simplicity
ReactJS uses JSX file which makes the application simple and to code as well as understand. We know that ReactJS is a component-based approach which makes the code reusable as your need. This makes it simple to use and learn.

Performance
ReactJS is well-known for its performance. This characteristic sets it apart from other frameworks available today. This is due to the fact that it controls a virtual DOM. The Document Object Model (DOM) is a cross-platform computer programming API for dealing with HTML, XML, and XHTML. The DOM is fully memory-based. As a result, we didn't write directly to the DOM while creating a
component. Instead, we'll create virtual components that will be converted into the DOM, resulting in smoother and faster performance.


This article was just as an intro to react. Tune in the blog for more. The next article will be building up in react from zero to becoming a badass react developer.

Thank you very much for taking time to read this. I would really appreciate any comment in the comment section.

You can connect with me on twitter @Kai_mwanyumba

Top comments (0)