Pathubs Logo Mark
PATHUBSFREE CAREER ROADMAPS
HomeExploreDiscoverCompare ⚖️My Progress 📊Support
Student Support & Feedback

Have Questions or Need Help?

Have questions, feedback, or suggestions for new roadmaps and interactive tools? Reach out to our team — we review every message to make practical learning better for everyone.

supportpathubs@gmail.com Official Telegram Support (@PathubsSupport)
Pathubs

100% Free, Zero-Paywall Tech Career Roadmaps, In-Depth Practical Content, and Live Interactive Virtual Labs for Learners Worldwide.

Popular Careers

  • Frontend Development
  • Backend Development
  • AI & LLM Engineering
  • Full Stack Web Dev
  • Data Analytics

Platform Tools

  • Career Discovery Quiz
  • Compare Careers

Contact & Info

  • About Us
  • supportpathubs@gmail.com
  • Support Pathubs

© 2026 Pathubs. All Rights Reserved. Structured learning, practical content, and hands-on practice for learners worldwide.

AboutPrivacy PolicyTerms & ConditionsSitemapRobots
Home/Full Stack Development/Frontend Architecture/React Fundamentals
REACT 19.X FUNDAMENTALS⏱️ 60 MIN ESTIMATED✦ CORE FRONTEND MILESTONE

React Fundamentals — Building Interactive UIs

Master the foundation of modern React development. Learn how component-based architecture, JSX, unidirectional props flow, and stateful memory (useState) enable predictable, high-performance user interfaces for production Full Stack applications.

Curriculum Outline
1Why React + Components (Declarative UI)2JSX — JavaScript XML & Expressions3Props & Component Composition4State & Events — useState & Re-rendering5Conditional & List Rendering (map & key)6Real React Build: Course Dashboard Lab7Component Communication (Data Down, Actions Up)8Debugging & 5 Common Anti-Patterns9Mini Challenge: Learning Resource List10Recap & Final Mental Model11React Fundamentals Mastery Quiz

1. Why React + Components

From Imperative DOM Spaghetti to Declarative Component Architecture

PARADIGM SHIFTDeclarative vs Imperative

What is React and Why Does it Exist?

In traditional vanilla JavaScript, building an interactive application requires imperative DOM manipulation. When an item is clicked or an API response arrives, you have to manually find the DOM element with document.getElementById(), attach event listeners, update innerHTML, toggle CSS classes, and keep the browser view in sync with your JavaScript data. As applications grow, this creates tangled spaghetti code where data and DOM state easily diverge.

React is a JavaScript library for building user interfaces. Instead of manually mutating DOM elements step-by-step, you write declarative code: you describe what the UI should look like for any given state, and React takes care of efficiently updating the actual browser DOM whenever your state changes:

MENTAL MODEL: UI AS A FUNCTION OF STATE State (Data) ───► [ React Component Function ] ───► UI (JSX) ▲ │ User Click / Event ─────┘
COMPONENT COMPOSITIONReal-World Learning Platform

Breaking Complex UIs into Reusable Building Blocks

React applications are structured as a tree of components. A component is an independent, reusable piece of UI. Consider how a real-world learning platform dashboard is decomposed:

App (Root Component) ├── Navbar (Branding, Search, UserProfile) ├── CourseList (List Container & Filter Controls) │ ├── CourseCard (Title: "React Fundamentals", Level: "Beginner") │ └── CourseCard (Title: "Express 5 APIs", Level: "Intermediate") └── Footer (Navigation Links & Copyright)

The Golden Rule of React Components:
A React component is just a JavaScript function that returns UI.

2. JSX — Describing UI with JavaScript Expressions

Syntax Extension That Merges Markup with the Power of JavaScript

SYNTAX ESSENTIALS

JSX is Not HTML

JSX looks like HTML, but under the hood, it is a syntax extension for JavaScript. Every JSX tag is transformed by modern compilers into JavaScript function calls (like jsx('div', { ... })). Because JSX is JavaScript, certain rules apply:

  • JavaScript Expressions with {}: Any valid JavaScript expression (variables, calculations, ternary checks, function calls) can be embedded directly inside curly braces.
  • className instead of class: Because class is a reserved keyword in JavaScript, HTML classes in JSX are written as className="course-card".
  • Self-Closing Elements: Tags with no children (like <img />, <input />, and <br />) must be explicitly self-closed with />.
  • Fragments (<>...</>): A component can only return a single root JSX element. If you have multiple siblings without wanting to introduce an unnecessary wrapper <div> in the DOM, wrap them in a Fragment.
CourseCard.jsxJSX in Action
// Notice: Function name is PascalCase (CourseCard), not lowercase!
function CourseCard({ title, level, isEnrolled }) {
  // JavaScript logic before the return
  const formattedLevel = level.toUpperCase();

  return (
    <article className="course-card">
      {/* JavaScript expressions evaluated dynamically */}
      <h2>{title}</h2>
      <p className="level-badge">{formattedLevel}</p>
      
      {/* Self-closing tag with dynamic attribute */}
      <input type="checkbox" checked={isEnrolled} readOnly />
    </article>
  );
}

3. Props & Component Composition

Unidirectional Data Flow: Passing Information from Parent to Child

IMMUTABLE INPUTS

What are Props?

React components use props (short for properties) to communicate with each other. Every parent component can pass information to its child components by giving them attributes, just like HTML attributes.

Props are Read-Only (Immutable)

A component must never modify its own props. If a child needs to react to changes, the parent must pass new prop values or pass a callback.

Destructuring Props Cleanly

Instead of writing props.title and props.level, destructure arguments directly: { title, level, children }.

ParentApp.jsx → CourseCard.jsxUnidirectional Flow
// 1. Parent Component passes data down
function App() {
  return (
    <main className="catalog">
      <CourseCard 
        title="React 19 Fundamentals" 
        level="Beginner" 
      />
      <CourseCard 
        title="PostgreSQL Advanced Schema Design" 
        level="Intermediate" 
      />
    </main>
  );
}

// 2. Child Component receives props and renders UI
function CourseCard({ title, level }) {
  return (
    <div className="card">
      <h3>{title}</h3>
      <span className="badge">{level}</span>
    </div>
  );
}

4. State & Events — useState & Re-rendering

Giving Memory to Components and Responding to User Interactions

COMPONENT MEMORY

Why Normal Variables are Not Enough

When a function executes, its local variables are created and then discarded when the function returns. Furthermore, modifying a plain JavaScript variable does not notify React that it needs to update the DOM. To retain data between render cycles and trigger an automatic UI update, React provides the useState Hook:

EnrollmentButton.jsxInteractive State with useState
import { useState } from 'react';

function EnrollmentButton() {
  // 1. Declare state variable and its setter function
  const [isEnrolled, setIsEnrolled] = useState(false);

  // 2. Event handler function
  function handleClick() {
    // Calling the setter triggers React to re-render the component with the new value!
    setIsEnrolled(prev => !prev);
  }

  return (
    <button 
      type="button"
      className={isEnrolled ? "btn-enrolled" : "btn-enroll"}
      onClick={handleClick}
    >
      {isEnrolled ? "Enrolled ✓" : "Enroll"}
    </button>
  );
}
THE RE-RENDER CYCLE: 1. User clicks <button> ──► 2. onClick triggers handleClick() │ 4. UI updates in browser ◄── 3. setIsEnrolled(true) causes React to re-render

5. Conditional & List Rendering

Rendering Dynamic Collections and Context-Aware UI

CORE PATTERNS

List Rendering with .map() and the Importance of key

In React, you transform arrays of data into arrays of JSX elements using standard JavaScript Array.prototype.map(). Every item rendered in a list must have a unique, stable key prop:

CourseList.jsxDynamic List & Empty State
function CourseList({ courses }) {
  // Pattern 1: Empty state conditional check
  if (courses.length === 0) {
    return <p className="empty">No courses found matching your criteria.</p>;
  }

  // Pattern 2: List rendering with unique, stable ID keys
  return (
    <div className="course-grid">
      {courses.map(course => (
        <CourseCard 
          key={course.id} // ⚠️ CRITICAL: Stable key helps React track DOM elements
          course={course}
        />
      ))}
    </div>
  );
}
Use Stable Database IDs

key={course.id} uniquely identifies the record even if the list is sorted, filtered, or items are removed.

Avoid Array Indices as Keys

key={index} causes bugs when items are reordered or deleted because indices change dynamically between renders.

6. Real React Build — Course Dashboard

Main Practical Activity: Executable Component Architecture & State Management

LIVE REACT 19 WORKSPACE
1. Convert repeated markup into reusable CourseCard
2. Pass course details and enrollment via props
3. Maintain enrolledIds state in parent
4. Pass onToggleEnroll callback down to cards
5. Render with .map() and stable key={course.id}
6. Render empty state when filter matches 0 courses
React 19 / JSX
Live Interactive Preview
● Application Active

Course Catalog

Enrolled: 1 / 4
React 19 Core Fundamentals & JSX
FrontendLevel: Beginner
Full Stack Node.js & Express 5 APIs
BackendLevel: Intermediate
PostgreSQL Architecture & Relationships
DatabaseLevel: Intermediate
FastAPI Microservices & Async Starlette
BackendLevel: Advanced

7. Component Communication

Data Flows Down via Props, Events Flow Up via Callbacks

DATA FLOW CONTRACT

How Parents and Children Coordinate

In React, components don’t talk directly across siblings. Instead, communication strictly follows a single, predictable cycle:

PARENT (CourseDashboard) │ Owns state: const [enrolledIds, setEnrolledIds] = useState([]); │ ▼ Passes props DOWN: course={c}, isEnrolled={...}, onToggleEnroll={handleToggle} CHILD (CourseCard) │ ▼ User clicks "Enroll" button CHILD invokes callback: onToggleEnroll(course.id) ▲ │ Event/Intention flows UP PARENT executes handleToggle(id) and calls setEnrolledIds(...) │ ▼ React re-renders Parent and updates DOM

Lifting State Up: If two child components need to share data (e.g., a search bar component and a course list component), move the state up to their closest common parent, and pass it down as props.

8. Debugging & Common Mistakes

Interactive Anti-Pattern Sandbox: 5 Real Pitfalls to Avoid

BUG 1Component Name Starts with Lowercase
JSX Tag Recognition
// ❌ BROKEN: React thinks <courseCard /> is a built-in HTML element!
function courseCard({ title }) {
  return <div>{title}</div>;
}

// In parent render:
return <courseCard title="React 19" />;
Warning in Browser Console:"The tag <courseCard> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter."
BUG 2Calling Event Handler Immediately in JSX
Infinite Render Loop
// ❌ BROKEN: Invokes handleEnroll during render phase!
function CourseCard({ id, onEnroll }) {
  // If onEnroll sets state, this causes: "Too many re-renders. React limits the number of renders to prevent an infinite loop."
  return <button onClick={onEnroll(id)}>Enroll</button>;
}
Error: The parentheses () execute the function immediately during component rendering rather than waiting for the click event.
BUG 3Mutating State Directly
Missing Re-render
// ❌ BROKEN: Direct array mutation
const [courses, setCourses] = useState(['React 19']);

function addCourse(title) {
  courses.push(title); // Mutates original array in place!
  setCourses(courses); // Memory reference is identical: React skips render!
}
Symptom: The array changes in memory, but the screen never updates because React detects courses === courses (same pointer).
BUG 4Missing or Unstable Array Index Key
Reconciliation Failure
// ❌ BROKEN: Using index as key in a mutable, sortable list
{courses.map((course, index) => (
  <CourseCard key={index} course={course} />
))}
Warning: When an item is deleted or filtered, index numbers shift. React mistakenly preserves internal state on the wrong elements.
BUG 5Attempting to Mutate Props
Component Purity Violation
// ❌ BROKEN: Modifying incoming props object
function CourseCard(props) {
  props.title = props.title.toUpperCase(); // Throws TypeError in Strict Mode!
  return <h3>{props.title}</h3>;
}
Error: Cannot assign to read only property of object. React props are frozen to enforce pure functions.

9. Mini Challenge: Build a Learning Resource List

Apply Components, Props, Dynamic Keys, and Completion Toggle State

REACT HANDS-ON CHALLENGE

Below is an interactive Learning Resource tracker. Toggle completion states, filter by resource type, and observe how state and keys keep each item isolated:

Completion Progress2 / 4 completed (50%)
Describing the UI: Your First Function Component
Level: Beginner
Article
Mastering JSX Expressions, Fragments & className
Level: Beginner
Article
Interactive State Management with useState Hook
Level: Beginner
Video
Building Unidirectional Callbacks & Props Down Architecture
Level: Intermediate
Exercise
10. Core Summary & Final Mental Model

Here is the definitive architectural flow for building interactive user interfaces with React:

1. React Component
A plain JavaScript function with a capitalized name that returns JSX describing the UI.
2. JSX Syntax
JavaScript extension allowing dynamic expressions inside {}, className, and Fragments.
3. Props (Data Down)
Read-only inputs passed from parent to child. Components must never mutate their own props.
4. State (Memory)
Managed by useState. Updating state via its setter schedules React to re-render the UI.
5. Callbacks (Actions Up)
Children trigger parent state changes by executing callback functions passed down as props.
6. Stable Keys
Always supply unique database IDs as keys in .map() for correct DOM reconciliation.
THE COMPLETE REACT INTERACTION LOOP: Data / State ──► React Component Function ──► JSX ──► Real Browser DOM ▲ │ │ │ State Update ◄─── Event Handler Callback ◄── User Interaction ─┘
TEST YOUR KNOWLEDGE

React Fundamentals Mastery Quiz

Validate your understanding of components, JSX expressions, props, stateful re-rendering, event handlers, and list keys.

Question 1 of 10Score: 0 / 10
What is a React function component fundamentally?