ReactJS
Tags: react, mernstack, javascript, webdev
Published: 2022-01-02 10:54:10

## What is React ?


![Photo by Ferenc Almasi](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nvxq9b2zaj6aof1vktdm.jpg)


Between many front-end frameworks that used in web apps, React JS takes a significant place among developers. We use React to make very dynamic user interfaces. Not only web based (React JS) but for the mobile application development (React Native) and Virtual Reality applications (React VR) also. ReactJS does not only give you the ability of creating user interfaces smooth and easy but also it allows rendering the data into the views (called components) efficiently by changing the nature of the components (called as the state of the component). Unlike other frameworks like  Angular, React does not frame the developer and define how the application developed to a structure it provides but gives you the freedom of planing. Basically it handles the View of the Model View Controller (MVC) and lets the developer use it. So as a matter of fact React cannot be defined as a framework. It is a library.


## What React do ?

It was founded by Jordan Walke who was a software engineer for Facebook in 2011. ReactJS happened in need of a method that does not mutate the state of real document object model (DOM) which normal js scripting or a framework like Angular would. By making a Virtual DOM and inject the components to this tree component and use this as main page to handle all user events while updating the real DOM by the virtual DOM which was facinating at the time. React uses a one-directional data flow which means that we can mutate the state of the view and make those actions affect the child views. So actions will be handled by parent and signals its child to trigger (we make instructions passed to the child via parent and call them to act due behavior). As soon as the parent state changes, react understands the change by comparing states of then and now before updating virtual DOM. Then the requested changes will returned back to client.


## Features of React


### 1. JSX


React uses JSX as syntax. This is a scripting format that allows both JS (javascript) and XML/HTML (markup). This allows us to use both of these syntax in one code. In earlier phases in frontend development history, the HTML tags like 'div' s were not easy to use in rendering and dom manipulation because they were used as string literals like quotes therefore was less-manageable to use and inside js syntax.


### 2. Unidirectional Data flow


As mentioned before, react's uni directional data flow makes modifications to components easy. Child components receive props which are immutable but takes callback functions passed to them as instructions to act accordingly when the parent state mutates. This process is called properties flow down; actions flow up.


### 3. Not only MERN


![Can I use React with...?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdib8bdyav5dpz9f5z3r.png)


The mern stack is a theoretical web-development framework. Which all are javascript frameworks we use to develop dynamic web apps in layerd architecture and MERN (which stands for Mongodb, ExpressJS, ReactJS, NodeJS) has the software developer society get very excited. But what if we need to use react with other runtime and server side environment like django, asp.net or laravel? The answer is we can. ReactJS allows this by only participating in handling the view components and supports easy development. 


## Importance of React


### 1. Rapid Development


Usage of reusable components in different contexts makes this easy. There are many tools that can help us with development from other frameworks and developer tools to debugging and testing. We can use the React developer tool to understand the component tree and how it works. Redux is a predictable state manager and using with react we can implement react to work like a one single tree of state objects and this makes easy for making calls to use back-end real-time with the front-end. 


### 2. Easy to Learn


React offers well explained documentation for learners and developers to understand the theory backing it. The basics are simple and can be used while learning. There is a big community that supports the react js and make content that help others learn react.


### 3. Dynamic UIs


Making responsive and smooth ui is easy with react because state-of-the-art ui component libraries like reactstrap, material design or tailwind makes this easy with their predefined properties to include them in web projects. We can make improve user experiences like making loaders and transitions while making user wait and to make user friendly.


### 4. Production value


Many web applications like social media platforms and business applications use react in their applications and web services today. These include Facebook, Instagram,  Dropbox, Netflix, IMDb, Airbnb, PayPal, Khan Academy etc. These web apps recognize and gives the credits to the react library with benefits.


### 5. Trending


As react is also easy to learn and with the backing of strong community support react library sure is the most trending front end library among many.


React 18 will be releasing soon as the latest version and it will contain new features like automatic batching. and transition APIs, a streaming server renderer with built-in support for React.lazy according to official react blog.


Learn about ReactJS with following links.


https://reactjs.org/docs/getting-started.html