I learned introduction of React...
P Mukila

P Mukila @mukilaperiyasamy

About: Java Fullstack dev | Backend & Frontend tips | Forever learning & building

Location:
Trichy,Tamilnadu.
Joined:
May 27, 2025

I learned introduction of React...

Publish Date: Jun 12
0 0

Sure! Here’s a clear and concise explanation of React, SPA, MPA, and the difference between ReactDOM and JS DOM:

What is React

ReactJS is a component-based JavaScript library used to build dynamic and interactive user interfaces. It simplifies the creation of single-page applications (SPAs) with a focus on performance and maintainability.

  • It is developed and maintained by Facebook.
  • The latest version of React is React 19.
  • Uses a virtual DOM for faster updates.
  • Supports a declarative approach to designing UI components.
  • Ensures better application control with one-way data binding.

SPA (Single Page Application)

An SPA is a web app that loads one HTML page and dynamically updates the content as the user interacts with the app, without refreshing the entire page. React is often used to build SPAs because it efficiently updates the UI on the client side.

MPA (Multi Page Application)

An MPA consists of multiple separate HTML pages. Every time a user clicks a link, the browser loads a new page from the server, causing a full page refresh.

     Each page is a separate HTML file.
     Full reload on navigation.
     Better for SEO and simple websites.
Enter fullscreen mode Exit fullscreen mode

React Components
A React component is a reusable piece of code that defines a part of the user interface. It accepts inputs called props and returns JSX to describe what should be displayed on the screen. Components help build and organize UI in a modular way.

  • Components are building blocks of a React app.
  • They are reusable pieces of UI, like buttons, headers, or entire pages.
  • Components can be written as functions or classes (functional components are more common now).

Return Function in Components

  • A React functional component is basically a function that returns JSX.
  • JSX looks like HTML but is actually JavaScript that tells React what to render.
  • The value you return from the component is what appears on the screen. Example:

function Greeting() {
return <h1>Hello, world!</h1>; // This JSX will be rendered in the UI
}

    Here, the Greeting component returns an <h1> element.
    React takes that and displays "Hello, world!" on the webpage.
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment