Why do we use React? Here are some of the benefits of using React JS.

Minami Koma
5 min readDec 4, 2021

Once you learnt plain JavaScript, you will now start learning something called React JS. You might wonder what it is and why you are recommended to use it.

Hence, here I will describe some benefits you will get by using React JS.

What is React ?

First thing first, I will briefly explain what exactly React is. When you look up the official page of React, it says ,

A JavaScript library for building user interface” .

That means React is a free opensource library which builds fast and interactive user interfaces with UI components and was created by Meta (formally known as Facebook) .

React can be used for both web and mobile applications and helps developers to make changes on data without reloading the pages.

How it all started

Before we dive into the benefits, let’s looks at the background of React.

React was first released in 2013 by one of the engineers at Facebook, called Jordan Walke.

Back in 2011, Facebook developers confronted issues to maintain codes since Facebook Ads app had gotten more and more features. At the beginning, they maintained the app by adding more developers but that was not an efficient solution and over time, the difficulty to maintain the app made the company slow down.

Thus Facebook needed to invent a better solution for this and Walke worked to make a prototype of React.

In 2012, Facebook acquired Instagram and Instagram wanted to use its latest technology, React so therefore Facebook decided to make it a opensource so anything outside of Facebook would also be able to utilize it.

Since 2013 when React was launched, it has been improved its functionality and within a few years, it became a mainstream among developers.

Key features of React

React introduced some features which made React a successful library.

1. JSX
2. Virtual DOM
3. One-way data flow
4. Component

  1. JSX

JSX stands for JavaScript XML, which allows us to incorporate HTML code into React.

2. Virtual DOM

Visual Document Object Model as known as virtual DOM is also a key feature in React. Virtual DOM is a in-memory data structure which allows us to update only components which are different from previous ones.

3. One-way data flow

The flow of data in React is one-way. This means that data has only one way to be transferred usually from parent component to child components. The data in parent component is usually passed as a prop.

4. Component

React is all about components. You break down the whole UI into small pieces and each component is dedicated to building those small pieces. And by combining all those small components, an app is built.

Now take a look why it has gained popularity among front-end engineers.

Benefits of React

Here are 5 benefits of React;
1. It allows easy creation yet has more functionality.
2. It allows faster performance
3. The components are reusable
4. It is relatively easy to learn
5. It helps to create rich user interface

  1. It allows easy creation yet has more functionality.

Unlike JavaScript, which coding can be very complicated, React makes it easier to make dynamic web applications because it allows to create more functionalities with less coding.

To create dynamic apps can be tricky as the coding might become complex, but React solves this issue by applying syntax called JSX.

JSX is a combination of HTML and JavaScript and optional extension of JavaScript. It is optional however in most of the cases, JSX is used as it makes the coding look simpler and cleaner.

Also as it is composed of HTML and JavaScript, nothing is new and it is very easy to write.

2. It allows faster performance

Conventionally, developers face problems when they update DOM as it gets the performance of applications slow down. Here React solves this issue by introducing virtual DOM.

Virtual DOM is a representation of real DOM and exists in memory as mentioned above. Hence when we write, we do on virtual components instead of writing on real DOM.

Virtual DOM compares current components to previous components and updates only the ones which have been changed.

This is very handy and makes the performance speed much faster than conventional web applications because without virtual DOM, everything in real DOM gets updated every time, which can take long time.

3. The components are reusable

React applications are consist of multiple components and each component is responsible for small functionality for the app. You start building small parts, which are used to create bigger parts, which are used to build an app.

They are independent and can be reused throughout the app, which helps developers to spend less time to create apps as well as to maintain apps.

Side note: components are similar to functions in JavaScript, however they are different as components return HTML. There are two types of components, Class components and Function components.

4. It is relatively easy to learn

React is a JavaScript library therefore anyone who comes from JavaScript background can easily get the concept of React and do not need to spend a lot of time to figure it out.

In addition, React is now one of the most popular libraries, which means there are many tutorials and documentations which you can refer to.

5. It helps to create rich user interface

Nowadays, users have emphasizes on user interface(UI) more and more hence to build web applications with rich UI is a key to be successful.

React helps to build apps with interactive UI through building components.

Common myths about React

Lastly, as an extra note, here is some myths when talking about React.

1.React is a framework
2. JSX is required to use React
3. It is very complicated to set up React apps

  1. React is a framework

There are certain number of people who believe React as a framework such as Angular js however React is a library. Since it is not a frameworks, React is much easier to incorporate and can be flexible enough to be adopted in many different projects.

2. JSX is required to use React

JSX is popular in developing React apps and you will see JSX in many cases. However JSX is an optional syntax therefore you don’t need to use it if you don’t like. However in many React apps, you will see JSX.

3. It is very complicated to set up React apps

It used to be troublesome to set up React apps as it required you to prepare many things before you actually started building apps. However, lately you don’t need to be worried about this since ‘create-react -app’ has been introduced. This command allows you to set up all the necessary components within a short time.

Conclusion — Is it worth learning it?

React is a helpful library when it comes to building high quality user interface and has used by many companies worldwide, including top companies such as Uber Eats, Airbnb and Dropbox.

This all makes sense as React makes it faster, simpler and more manageable to create apps.

As mentioned above, it is not too complicated to learn especially if you have learnt JavaScript. Furthermore, lately many employers care if you know React so as a conclusion and as my opinion, it can be said that it is worth learning it….

--

--