In this tutorial, we will discuss about React, why we use react, advantage and disadvantage of React.
1. ReactJS Introduction
If a developer wants to create a changeable and large web application without reloading it, they often choose React. In fact, React is fast, simple yet very effective to do that. Behind it's biggest features is Virtual DOM.
These are the some companies which are using RactJS.
2. Why we use ReactJS?
There are following factors keep in mind when we choose react:
1. Improved performance
React uses Virtual DOM, Virtual DOM is a copy of the site original DOM. ReactJS uses this copy to see what parts of the actual DOM need to change when an event happens like you are clicking a button.Virtual DOM can help you see what changed after a user action and selectively updates that section of the actual DOM only. This will enhance the performance of apps.
2. Reusable components
React Components are the building blocks of any React application. A single application usually consists of multiple components. These components have their logic and controls and they can be reused throughout the application. So web applications quickly and efficiently with significantly less code than javascript.
3. Unidirectional data flow
React follows the data flows in a single direction not in both direction. So it becomes easier to debug errors and know where a problem occurs in an application.
4. Support both Web and Mobile apps
React is used for the development of web applications and React Native derived from React itself that is hugely popular and is used for creating beautiful mobile applications. So It support both Web and Mobile Application.
5. Dedicated tools for easy debugging
Facebook has released a Chrome extension that can be used to debug React applications. This makes the process of debugging React web applications faster and easier.
3. Advantage of ReactJS
The below are the following advantages when we use ReactJS in our application.
Virtual Dom - ReactJS use virtual DOM which enhance the performance.
Reusable components - React Components are the building blocks of any React application. A single application usually consists of multiple components. These components have their logic and controls and they can be reused throughout the application. So web applications quickly and efficiently with significantly less code than javascript.
SEO friendly - That helps developers to be easily navigated on various search engines.
Testing - ReactJS applications are extremely easy to test. It offers a scope where the developer can test and debug their codes with the help of native tools.
JavaScript Library benifit - This library provides more flexibility to developers.
Support Web and Mobile App - React is used for the development of web applications and React Native derived from React itself that is hugely popular and is used for creating beautiful mobile applications.
4. Disadvantage of ReactJS
The below are the following disadvantages when we use ReactJS in our application.