Intro To React

React is a JavaScript library. Is is open source.

React introduces an user to component based architecture where you build multiple components and put them together.

A component can be considered as a Lego game, which joined together create something unique.

SPA Vs MPA

In Multi Page Application(MPA) if a user navigates from one page to other, the browser will reloads the resources like CSS , HTMLand JS even if there are some same components in both the pages like “Nav Bar” etc.

However in case of Single Page Application(SPA) works inside a browser. Which means when you hit a url in SPA you download all the resources like JS, HTML, CSS once. And post that when you navigate to a different page inside that webapp , you don’t reload that page and resources. You just destroy some components inside webapp and replace it with new ones.

In SPA clicking on the link on page1 will navigate the user to page2, however the nav bar and footer does not reload neither does the browser.

To fetch the data the browser makes an API call to server and display it on Page2

React vs Others

Before jumping into this, let’s discuss what is the difference between library and a framework.

Library – library is used to some some of the common problems for example you want to make an ajax call or you want to manipulate the DOM. You can use jquery for that. One more example of a library is lodash which can be used to perform operation on arrays.

React is a library which is the View part of the MVC framework.

MVC Framework

Model is the data of the application.

View is what the user see.

Controller manipulate and change the data.

Framework: Framework provides structure for an application. For example in angular there are view which tells how your application should be structured.

Requirement for React:

  • node.js
  • chrome browser
  • VS Code

About the author

Deepak Sood

Deepak Sood is Lead Consultant in an IT firm holding expertise in Devops and QA Architecture with 8 years of experience.

His expertise is in building highly scalable frameworks. His skills include Java, Configuration Management, Containers, and Kubernetes.

Reach out to him using contact form.

View all posts