Sitemap
Hemasri

Hemasri

4 min readOct 2, 2026

--

Getting Started with React

React is a JavaScript library which is used to create user interfaces. It is mainly used to build web applications. React helps us to create reusable and interactive UI.

Press enter or click to view image in full size

React, Angular and Vue

React, Angular and Vue are used to build web applications and user interfaces.

React is a library, whereas Angular is a framework. Vue is also used to build user interfaces.

React is mainly known for its speed and component-based development.

Single Page Application

Single Page Application is called SPA.

In SPA, only one page is loaded. When we move from one part to another, the whole page does not reload. Only the required content changes.

React, Angular and Vue can be used to create Single Page Applications.

Multi Page Application

In a Multi Page Application, there are multiple pages.

When we move from one page to another, a new page is loaded from the server.

A normal HTML website can be an example of a Multi Page Application.

html — spa

website — mpa

Press enter or click to view image in full size

What is Virtual DOM?

DOM means Document Object Model. It represents the elements of a webpage.

Virtual DOM is a copy of the Real DOM. React uses the Virtual DOM to check the changes in the UI.

When something changes, React compares the old Virtual DOM with the new Virtual DOM.

It finds what has changed and updates only that part in the Real DOM.

Reconciliation

Reconciliation is a mechanism in React.

It is the process of comparing the old Virtual DOM and the new Virtual DOM.

When there is a change in the application, React checks the changes and updates the required part of the Real DOM.

So, reconciliation helps React to update the UI.

Press enter or click to view image in full size

How React Works?

React works through the reconciliation process.

First, React creates a Virtual DOM. When something changes, React creates a new Virtual DOM.

Then React compares the old Virtual DOM and the new Virtual DOM. It finds the changes and updates the required part in the Real DOM.

Virtual DOM is not the actual DOM. It is a copy or representation used by React to find the changes.

Render

Render means displaying something on the screen.

In React, the component returns the elements and React renders them on the webpage.

For example, if a component returns a heading and paragraph, React renders them on the screen.

What is an Element?

An element means one item.

In HTML, an element is created using a tag and attributes.

Get Hemasri’s stories in your inbox

Join Medium for free to get updates from this writer.

For example, "<h1>", "<p>" and "<div>" are HTML elements.

In React, we also have React elements.

HTML Element and React Element

HTML elements are mostly static.

React elements can contain dynamic values. We can use JavaScript values inside React elements.

So, React elements are used to describe what we want to display on the screen.

What is a Component?

A component is a function that returns React elements.

We can group multiple React elements together and create a component.

For example, a component can contain a heading, paragraph and button.

Components help us to divide the UI into small parts.

React Component

A React component is a function that returns React elements.

The component name should start with a capital letter.

For example:

"Home"

"Login"

"About"

Component names are usually written using Pascal Case.

Normal function names can start with a small letter and follow camelCase.

Static and Dynamic

Static means the value does not change.

Dynamic means the value can change.

In React, we can use JavaScript inside JSX to display dynamic values.

When we use "{ }", we can put JavaScript values or expressions inside it.

A React component is also a function. React calls the component and uses the returned elements to display the UI.

Fragment

Sometimes we need to return multiple elements from a component.

We can use a "<div>" to group the elements, but it will add an extra element to the DOM.

To avoid this, React provides Fragment.

We can write Fragment using:

"<>"

"</>"

Fragment helps us to group multiple elements without adding an extra element to the DOM.

For example, instead of using a "div" just for grouping, we can use Fragment.

Why do we use Fragment?

If we use many "div" elements only for grouping, the DOM can have unnecessary elements.

Fragment helps us avoid this.

It groups the elements without adding an extra "div" to the DOM.

React is a JavaScript library used to build user interfaces.

It uses components, JSX, Virtual DOM and reconciliation to create and update the UI.

By using components and fragments, we can make the React code simple and reusable.

--

--