Skip to main content
⏱️ Duration: 20 minutes | Learn how React revolutionizes UI development.

What is React?

React is a JavaScript library for building user interfaces. It lets you create reusable components that manage their own state. Ever noticed how Netflix updates smoothly without reloading the whole page? That’s React! 🎬
Fun Fact: React was created by Meta (Facebook) in 2013 and now powers billions of users on Facebook, Instagram, and WhatsApp! The engineer who created it, Jordan Walke, built the first version in just a few weeks!

Why React?

React Official Tutorial

Learn React step-by-step with the official interactive tutorial

Components

Components are the building blocks of React apps. Think of them as custom HTML elements.

Your First Component

Beginner Tip: Component names must start with a capital letter! Greeting not greeting.

JSX: HTML in JavaScript

JSX lets you write HTML-like code in JavaScript:

JSX Rules


Props: Passing Data

Props let you pass data to components:

State: Making Things Interactive

State is data that changes over time. Use useState to add state:
Try it yourself! 👇
Important: Never modify state directly! Always use the setter function.

Handling Events

React makes event handling easy:

Rendering Lists

Use .map() to render arrays of components:
Beginner Tip: Always add a unique key prop when rendering lists. Use IDs, not array indices.

Conditional Rendering

Show different content based on conditions:
Try it! 👇 Toggle login state:

Complete Example: Task Manager

Try it! 👇 Add tasks and click to toggle:

React Cheat Sheet


Next up: Next.js →