Anandi Sheladiya
Contact
  • About Anandi
  • SKILLS & EXPERIENCE
    • Frontend
      • ReactJS
      • Next.js – The React Framework for Production
      • ChartJS / D3.JS / Fabric JS
      • Three.JS: The JavaScript Library for 3D Graphics
      • HTML/CSS/JS/Tailwind CSS/Bootstrap
      • Material UI – The Ultimate React UI Framework
      • ShadCN/UI – The Modern UI Library for React
    • Backend
      • NodeJS & ExpressJS
      • Web3.JS
      • Python & Django
      • GoLang
      • TypeScript
    • Database
      • PostgreSQL
      • MongoDB - NOSQL Database
      • MySQL
    • API
      • REST API
      • GraphQL API
      • RPC (Remote Procedure Call)
      • WebSocket
    • Solidity
    • Layer 1 Blockchain
      • Ethereum
      • Solana
      • Bitcoin
      • Hyperledger
      • Binance
      • Avalanche
      • Cardano
      • Polkadot
      • Near Protocol
      • Algorand
      • TON (Telegram Open Network)
    • Optimistic Rollups (L2 on Ethereum)
      • Arbitrum
      • Base
      • Mantle
    • ZK-Rollups (L2 on Ethereum)
      • zkSync Era
      • Polygon zkEVM
    • Wallet Integration
      • Reown Appkit
      • Rainbow Walletkit
      • Web3 Modal
      • WalletConnect
      • Wagmi
      • Metamask & Safewallet SDKs
    • Web3 SDKs & API Providers
      • Alchemy
      • Moralis
      • QuickNode
      • BitQuery API & Stream
      • ThirdWeb
      • Infura
      • Li.Fi
      • 1Inch API
      • Uniswap API
      • OpenZeppelin
    • Web3 Middleware/ UX Infrastructure Platform
      • Biconomy
      • Pimlico
      • Alchemy AA
      • Safe (formerly Gnosis Safe)
      • ZeroDev
    • On Chain Trading Platform & Telegram Bot
      • Bullx
      • Wave Bot
      • GMGN
      • Shuriken
      • Magnum Trade
      • Trojan
  • PROTOCOLS
    • ERCs & EIPs
      • ERC-20: The Standard for Fungible Tokens
      • ERC-721: The Standard for Non-Fungible Tokens (NFTs)
      • ERC 4337
      • ERC 6551: Token Bound Accounts (TBA)
      • ERC 7702
      • EIP 4844 (Proto-Danksharding)
      • Ethereum Pectra
  • ARTICLES
    • Medium
Powered by GitBook
On this page
  • React.js – A Powerful JavaScript Library for Modern Web Development
  • Introduction
  • Why Use React.js?
  • Key Features of React.js
  • Advanced Topics in React.js

Was this helpful?

  1. SKILLS & EXPERIENCE
  2. Frontend

ReactJS

React.js – A Powerful JavaScript Library for Modern Web Development

Introduction

React.js is an open-source JavaScript library developed and maintained by Meta (formerly Facebook). It is widely used for building interactive and efficient user interfaces (UIs), particularly for single-page applications (SPAs) and mobile applications. React’s component-based architecture enables developers to create reusable UI elements, leading to scalable and maintainable codebases.

Why Use React.js?

React has become one of the most popular front-end libraries due to its:

  • Component-Based Architecture – Encourages reusability and modularity in code.

  • Virtual DOM (VDOM) – Optimizes rendering for better performance.

  • Unidirectional Data Flow – Ensures predictable application behavior.

  • Rich Ecosystem – Supported by a vast community with libraries like React Router, Redux, and Next.js.

  • Cross-Platform Support – Can be used in web applications, mobile apps (React Native), and even desktop applications (Electron).

Key Features of React.js

1. JSX (JavaScript XML)

React uses JSX, a syntax extension that allows developers to write UI components using an HTML-like structure inside JavaScript.

const HelloWorld = () => {
  return <h1>Hello, World!</h1>;
};

2. Components and Props

React applications are built using components, which can be either functional or class-based. These components accept props to make them dynamic.

const Welcome = (props) => {
  return <h1>Welcome, {props.name}!</h1>;
};

3. State Management

React provides useState() for handling component-level state. For larger applications, state management libraries like Redux, Recoil, or Zustand can be used.

import { useState } from "react";

const Counter = () => {
  const [count, setCount] = useState(0);
  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>Increment</button>
    </div>
  );
};

4. React Hooks

Hooks allow functional components to have state and lifecycle methods. Popular hooks include:

  • useState – Manages state in functional components.

  • useEffect – Handles side effects such as API calls.

  • useContext – Provides global state without prop drilling.

Example of useEffect for fetching data:

import { useEffect, useState } from "react";

const FetchData = () => {
  const [data, setData] = useState([]);

  useEffect(() => {
    fetch("https://jsonplaceholder.typicode.com/posts")
      .then((response) => response.json())
      .then((json) => setData(json));
  }, []);

  return (
    <ul>
      {data.map((item) => (
        <li key={item.id}>{item.title}</li>
      ))}
    </ul>
  );
};

5. React Router

React Router enables client-side navigation without reloading the page.

import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import Home from "./Home";
import About from "./About";

const App = () => {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/about" element={<About />} />
      </Routes>
    </Router>
  );
};

Advanced Topics in React.js

  • Next.js – A React framework for server-side rendering (SSR) and static site generation (SSG).

  • React Native – Builds mobile apps using React components.

  • State Management Solutions – Redux, MobX, Recoil, Zustand.

  • Performance Optimization – Lazy loading, memoization (React.memo), and code splitting.

PreviousFrontendNextNext.js – The React Framework for Production

Last updated 3 months ago

Was this helpful?