What is React?

Malik Bilal
Dec 9, 2018 · 3 min read

React also known as React.Js is a JavaScript library .Develop by Facebook in March 2013 currently it is the most popular JavaScript framework/library .It uses for building fast user interfaces.React can be use to develop single page application & with React Native which is a Framework of React we can build hybrid mobile apps.React make easy to develop single page application because it is a component base library with magic of Virtual DOM. Also it is easy library to learn. A normal JavaScript developer can learn this library in 1 to 2 months. To know the value of React first we have to take a look on Single page Application ,Virtual DOM.

Single Page Application vs Multi Page Application:

Single Page Application Aka (SPA):

Single Page Application or SPA is a web application which runs on a single page .Without re-rendering the whole DOM it dynamically update the different Component of Application using Virtual DOM .It save time and data because there is no need to reload all the css js and HTML files it just get these file in initial load. Nowa days SPA getting pushes the new boundaries of web developing many Framework and libraries can make SPA LikeReact.Js,Angular,Vue.Js….Google, Facebook and Udemy use Single Page Application in their web.

Multi Page Application Aka (MPA):

Now Lets talk About Multi Page Application (MPA) it work on old traditional way .You have to render all the css html and javascript to make any change or go to another route/page . Every request to server re-renders the DOM with every file attached to it .These application are large and bigger then SPAbecause they need more data.Due to render every single page every time they can have many levels of UI. MPA is suitable for Ecomerce because it have many categories and content you need many complete seprate route for your web so this may be a better choice .

Virtual DOM vs DOM:

Virtual DOM is not come with React.Virtual is a render method to render the simple plane JavaScript object in DOM element from the memory .React adopt this method to make things happen fast because it is lightweight and store in memory so there is no need to render a new raw DOM component .Virtual DOM never render a real DOM element or target any DOM element .Whenever the state of any component change it match that component from memory and only pick the changed part of it and render its object .This method also known as Shadow DOM.

React vs Angular:

React and Angular both are similar in terms of their component-based architecture. But there is a big difference Angular is a framework with a complete solution, while React is a library. React only take care of rendering the view and making sure that the view is in sync with the latest state.While building application with React we need to use different libraries to use with it .But when it comes to Angular its a complete package it comes with everything you need in development but also you are bound with those thing .In React its not bad because we can chose what we want to use to complete the task from any library but in Angular we have to wait until the next version comes with our solution .

Library vs Framework:

The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you.

A library is just a collection of class definitions. The reason behind is simply code reuse, i.e. get the code that has already been written by other developers. The classes and methods normally define specific operations in a domain specific area.

In framework, all the control flow is already there, and there’s a bunch of predefined white spots that you should fill out with your code. A framework is normally more complex. It defines a skeleton where the application defines its own features to fill out the skeleton

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade