Why you should use React?
Tags: react
Published: 2020-06-04 10:20:30

#What is React

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/svtmfok7myr0coyf2oe3.png)

React is a widely used open-source javascript library. It’s used specifically for large, complex web interfaces as well as single-page applications. It’s used for handling the view layer for web and mobile apps. It is maintained by Facebook and a community of individual developers and companies.

#Why we use it
<br/>
##It ensures faster rendering (Virtual Dom)

DOM (document object model) is a logical structure of documents in HTML format. Web browsers are using layout engines to transform or parse the representation HTML-syntax into document object model, which we can see in browsers.

The main concern about traditional DOM is the way it processes changes, i.e., user inputs, queries, and so on. A server constantly checks the difference caused by these changes to give the necessary response. To respond properly, it also needs to update the DOM trees of the whole document, which is very slow because DOM trees are fairly large today, containing thousands of elements.

The team behind React managed to increase the speed of updates by using virtual DOM. Unlike other frameworks that work with the Real DOM, ReactJS uses its abstract copy – the Virtual DOM. It updates even minimalistic changes applied by the user, but doesn’t affect other parts of the interface.

##Simplicity

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/okjt5hfvgyuylgw5bh5e.png)


The first thing that gets so many people to use ReactJS in their projects is probably its simplicity. React is a JavaScript library so if a developer is familiar with JS functions, they will have an easier start with ReactJS.

With this library, developers define interfaces with an HTML-like syntax called JSX. As a result, HTML and CSS code is produced. React’s API is very small, yet powerful, and all you need to do before you start is to learn a few basic functions.

##Reusable Components (can be used in React Native too!)

Each React project is built using the so-called reusable components. This means that each element of the interface that you’ve already built, can be used anywhere in your project by just calling from other components. You write such a function once and can reuse it anywhere. You can group these elements into sections or pages and insert them anywhere around the project with the same functions.

Reusable elements in ReactJS also follow a simple mental model. If a component is given the same data multiple times, it will always yield the very same set of HTML and CSS. It makes it easy to reason about and to test.

##It is SEO friendly (Server Side Rendering)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bp0c36iq8pzg7sx50qtw.png)

Another React benefit is its ability to deal with a common search engine failure to read JavaScript apps. As a solution, React can run on the server, rendering and returning the virtual DOM to the browser as a regular webpage.

##It is backed by a strong community

It has very strong community support. With over 150k stars on Github and many regular contributors, React is continuously getting better.

#Minor Drawbacks

##High pace of development

One of the drawbacks of React is, it keeps on changing with time. It is a constant learning process for the developers, and they have to learn new ways of doing things that can become a problematic situation for them.

And because of its fast changes a little time is left to write proper documentation.