Back to Courses
React 19 & Next.js Architecture MasterclassReact 19 & Next.js Standard
0 / 4 done
Part 1: React Fundamentals, JSX & StateBeginner
Part 2: Lifecycle, Side Effects & Custom HooksIntermediate
Part 3: Next.js App Router & Server ComponentsAdvanced
React 19 & Next.js Architecture Masterclass Track Progress
0 / 4 Lessons (0%)
React 19 & Next.js Architecture Masterclass/Beginner/The React Mental Model & JSX Syntax

The React Mental Model & JSX Syntax

Key Takeaway:React is a declarative library for building user interfaces by breaking screens into reusable components.

What Is It & Why Use It?

Instead of manually mutating the DOM with imperative commands (document.getElementById), React lets you declare what the UI should look like for a given state. JSX allows writing HTML-like markup directly inside JavaScript, which the compiler compiles into React.createElement() calls.

React Declarative Rendering Loop

Interactive Diagram
Visual Architecture & Runtime Schematic

React Declarative Rendering Loop

Node 01

Component State / Props

Entity state & role in architecture: Component State / Props

Example Code

// A standard functional React component
function FeatureCard({ title, description, badge }) {
  return (
    <div className="card" style={{ padding: "16px", background: "#1e293b", borderRadius: "8px", color: "white" }}>
      <span style={{ background: "#0284c7", padding: "4px 8px", borderRadius: "4px", fontSize: "12px" }}>
        {badge}
      </span>
      <h3 style={{ margin: "8px 0", color: "#38bdf8" }}>{title}</h3>
      <p style={{ margin: 0, color: "#94a3b8" }}>{description}</p>
    </div>
  );
}

// App renders component with custom props
export default function App() {
  return <FeatureCard badge="Fast" title="Server Components" description="Zero bundle size on client!" />;
}
Language: javascript

Code Line-by-Line Breakdown

function FeatureCard({ title, ... })

Functional component destructuring incoming props.

className='card'

JSX uses className instead of class because class is a reserved word in JS.

{badge}

Curly braces allow embedding any JavaScript expression directly into the markup.

Remember These Rules

React components must be capitalized (FeatureCard, not featureCard).
Components must return a single root element (or a React Fragment <> ... </>).
Props are strictly read-only; never mutate props directly.
Quick Test

Why does JSX use className instead of the standard HTML class attribute?