React Introduction

React is a JavaScript library for building user interfaces out of reusable pieces called components. It's the most widely used way to build interactive web UIs.

Declarative UI

Instead of manually updating the DOM step by step, you describe what the UI should look like for a given state. When the state changes, React figures out the minimal DOM updates and applies them.

App.jsx
function Greeting({ name }) {
  return <h1>Hello, {name}!</h1>;   // describe the UI for this data
}

The core ideas

  • Components β€” self-contained, reusable pieces of UI.
  • Props β€” data passed into a component from its parent.
  • State β€” data a component owns that can change over time.
  • One-way data flow β€” data flows down; events flow up.

How React updates the page

React keeps a lightweight virtual representation of the UI. On a state change it re-renders, compares (β€œreconciles”) the new tree with the old, and updates only what actually changed β€” which is why it's fast.

Library, not framework

React handles the view layer; you add libraries for routing, data fetching, and state as needed (covered later). Full frameworks like Next.js build on React with more built in.

Note: This course uses modern React 19 with function components and hooks β€” the current standard. Older class components still exist in legacy code, but you'll write hooks.
Free preview. Sign in and subscribe to unlock all 809 lessons across 25 courses.
React Introduction β€” React.js | Full Stack Learning Simplified