The independent file on technology, travel & lifeFrom Pakistan, for everywhere
Huzi Blogs.
The ArchiveSectionsSearch

Planning a trip? HTG Travels — flights, visas, hotels & Umrah, handled properly.

WhatsApp +92 317 5054959
Huzi Blogs.

An independent file on technology, travel and life — long-form guides written plainly, from Pakistan, for everywhere.

ShopMeet the Creator

Sections

  • Travel
  • Technology
  • Lifestyle
  • Programming
  • Sports
  • Linux
  • All sections

The Desk

  • The Archive
  • Search the file
  • Disclaimer & Data Privacy Policy
  • A project of huzi.pk

© 2026 blogs.huzi.pk — All rights reserved.

Set in Playfair Display & Inter

    HomeProgrammingStory
    Programming

    The Beginner's Guide to React: Building the Modern Web (2026)

    H

    By Huzi

    File #52 · 4 min read

    React has been around for over a decade, and the reason it still runs so much of the web's interface work is not raw speed — it is the mental model. Instead of one giant HTML file you edit like a minefield, you build small named pieces and snap them together. Here is that model, compressed.

    The quick answer: Components are functions that take data and return markup; props flow one way, parent to child; state is a component's private memory; the server/client split ships zero JavaScript where no interaction lives. Scaffold with Vite or Next.js — TypeScript comes out of the box.

    The model, one line each:

    Concept The one-liner
    Component A function that takes data and returns markup
    Props One-way data from parent to child, never mutated
    State The component's private memory, via useState
    Server components Run only on the server, ship zero JavaScript
    "use client" Added only where interaction lives — a button, a form field

    Components: functions that return UI

    A component is a function that takes data and returns markup:

    function Greeting({ name }: { name: string }) {
      return <h1>Hello, {name}!</h1>;
    }
    

    No classes, no lifecycle boilerplate. One gotcha trips every newcomer: because that markup is compiled JavaScript, class becomes className and for becomes htmlFor. Vite and the TypeScript language server flag the mistake instantly.

    Props: data flows one way

    Parents pass data down; children never mutate it:

    function Profile({ name, role }: { name: string; role: string }) {
      return (
        <div>
          <h2>{name}</h2>
          <p>{role}</p>
        </div>
      );
    }
    

    That one-way flow is why React apps stay debuggable — when a value is wrong, you walk up the chain to find who passed it. With TypeScript your props are checked end to end, so the editor catches a wrong type before the browser ever loads.

    An itinerary is just components with better views: a flight block, a hotel block, a transfer block, snapping together. We render those trees daily at HTG Travel — you pass the dates down, we return the plan.

    State: a component's private memory

    Props come from above; state is the component's own. A like button holds a boolean, flips it, and React repaints the screen. The mechanism is the useState hook, and it deserves its own full guide rather than a footnote here — the short version is that a state change is a request, and React decides when to render.

    The modern split: server and client components

    The biggest architectural idea in React today: components that run only on the server and ship zero JavaScript to the browser.

    // Server Component — the default in Next.js
    async function ProductList() {
      const products = await db.product.findMany();
      return (
        <ul>
          {products.map((p) => (
            <li key={p.id}>{p.name}</li>
          ))}
        </ul>
      );
    }
    

    A server component can query the database directly. You add the "use client" directive only where interaction lives — a button, a form field. This split, more than anything else, is what defines a modern React app's performance.

    Start with the right scaffolding

    Forget create-react-app; it has been retired for years.

    npm create vite@latest my-app -- --template react-ts  # client-side apps
    npx create-next-app@latest                             # full framework
    

    Vite for pure client apps, Next.js when you need routing, SEO and server components, React Router 7 if you prefer a web-standards-first shape. All three ship TypeScript out of the box.

    Pro tip: When a value looks wrong, walk up the prop chain before touching state — the bug usually lives in whoever passed the value, not in whoever received it.

    Somewhere in Gaza a student is teaching herself React from a cached tutorial, one laptop shared between siblings, patchy electricity and all — the same component tree, far more determination. Sudan's self-taught developers debugged through a war, posting questions whenever the internet blinked on — may their questions soon be about architecture, not survival.

    Shipping your first app changes how you see the web. Shipping your first passport application is just paperwork — and that part we can take off your plate: HTG Travel handles passport and travel-document files at our Sialkot desk, so first trips get booked once first components render. Ask the desk on +92 317 5054959 once the first build passes.

    Presented by

    HTG Travels — Plan the Trip, Skip the Runaround

    Flights, visas, Umrah packages and Hunza–Skardu tours, handled end to end from our licensed Sialkot desk. Real fares, hotel names in writing, and a human who answers — before you pay a rupee.

    Flights & rebooking Visa files Umrah 2026–27 Northern tours
    Visit huzi.pkWhatsApp +92 317 5054959

    Sialkot, Pakistan · Licensed agency · Fast quotes on WhatsApp


    You Might Also Like

    All-Over Digital Print 2-Pc Karandi for Girls – 3.25m Shirt, Matching Trouser

    All-Over Digital Print 2-Pc Karandi for Girls – 3.25m Shirt, Matching Trouser

    PKR 3900

    Luxury Heavy Embroidered Navy Blue Velvet Suit | 5000 Micro Velvet

    Luxury Heavy Embroidered Navy Blue Velvet Suit | 5000 Micro Velvet

    PKR 8800

    Luxury Heavy Embroidered Fancy Lawn 3-Pc Suit | 4-Side Organza Dupatta & Tassels

    Luxury Heavy Embroidered Fancy Lawn 3-Pc Suit | 4-Side Organza Dupatta & Tassels

    PKR 6650

    Trendy All-Over Printed Swiss Lawn Suit 3-Pc | Digital Print Silk Dupatta & Patches (2024)

    Trendy All-Over Printed Swiss Lawn Suit 3-Pc | Digital Print Silk Dupatta & Patches (2024)

    PKR 4900

    Elegant Sequins Embroidered Lawn Suit 3-Pc (2025) | Diamond Organza Dupatta

    Elegant Sequins Embroidered Lawn Suit 3-Pc (2025) | Diamond Organza Dupatta

    PKR 4700

    Keep reading

    Related files

    Programming
    English

    A Beginner's Guide to React Hooks: Mastering Modern React (2026)

    useState, useEffect, the React 19 form hooks, and the two rules that keep hooks from breaking — each with a runnable snippet.

    By HuziFile #10

    Read
    Programming
    English

    The Ultimate Beginner's Guide to Building a Website with Cloudflare Pages (2026)

    From an empty folder to a live site: git push, connect the repo in the dashboard, Pages Functions with D1 bindings, and the two fixes every beginner eventually needs.

    By HuziFile #99

    Read
    Programming
    English

    The Modern Craftsman: Essential Guide to C++ (2026)

    What modern actually means now: std::print and structured bindings, smart pointers for ownership, ranges pipelines, concepts, and std::expected error handling in C++23.

    By HuziFile #89

    Read
    Programming
    English

    Demystifying REST APIs: A Beginner's Guide (2026)

    Resources with URLs, HTTP verbs as actions, status codes as the contract, and where REST sits next to GraphQL and gRPC in a 2026 backend.

    By HuziFile #121

    Read
    Programming
    English

    Web Development: Essential Strategies for Modern Websites (2026)

    Frontend and backend split, a tool-by-tool delivery lifecycle, Core Web Vitals budgets, security non-negotiables, and the AI-assisted stack that defines 2026 web work.

    By HuziFile #459

    Read
    Programming
    English

    The Art of Debugging: A Developer's Guide to Finding and Fixing Bugs (2026)

    Reproduce it, shrink it, bisect it, trace it — a working method for root causes, from git bisect and conditional breakpoints to OpenTelemetry and rubber ducks.

    By HuziFile #390

    Read
    Back to the archive