</>
CodeLearn Pro
Start Learning Free β†’
React web front-end development
Web Front-End Β· Intermediate Β· JavaScript Library

Learn React

The world's most popular UI library. Build fast, interactive web apps from reusable components. Master hooks, props and state β€” and you can build anything from a todo list to a full-stack web application.

βš›οΈ
#1 UI Library
Used by Facebook, Netflix, Airbnb, Uber and millions of developers worldwide
♻️
Component-Based
Build reusable UI pieces that snap together like LEGO β€” once, use everywhere
πŸͺ
Hooks
useState, useEffect and custom hooks make stateful logic simple and reusable
πŸš€
Huge Ecosystem
Next.js, React Native, React Router, Zustand β€” a complete solution for any app

React at a Glance

Build UIs from components. Each component is a JavaScript function that returns JSX.

Greeting.jsx
JSX
import React from 'react';

// A React component is just a function
// that returns JSX
function Greeting({ name, role = 'Student' }) {
  return (
    <div className="card">
      <h1>Hello, {name}! πŸ‘‹</h1>
      <p>Role: {role}</p>
      <p>Welcome to React.</p>
    </div>
  );
}

// Usage:
// <Greeting name="Alice" role="Developer" />
// <Greeting name="Bob" />   ← uses default role

πŸ“± Renders as

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Hello, Alice! πŸ‘‹            β”‚
β”‚ Role: Developer             β”‚
β”‚ Welcome to React.           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Hello, Bob! πŸ‘‹              β”‚
β”‚ Role: Student               β”‚
β”‚ Welcome to React.           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Counter.jsx
JSX
import { useState } from 'react';

function Counter() {
  // useState returns [currentValue, setter]
  const [count, setCount] = useState(0);

  return (
    <div>
      <h2>Count: {count}</h2>
      <button onClick={() => setCount(count + 1)}>
        + Increment
      </button>
      <button onClick={() => setCount(count - 1)}>
        βˆ’ Decrement
      </button>
      <button onClick={() => setCount(0)}>
        Reset
      </button>
    </div>
  );
}

πŸ“± Renders as

Count: 0
[+ Increment] [βˆ’ Decrement] [Reset]

After clicking + three times:
Count: 3
[+ Increment] [βˆ’ Decrement] [Reset]
LanguageList.jsx
JSX
function LanguageList({ languages }) {
  return (
    <ul>
      {languages.map((lang) => (
        <li key={lang.id}>
          <span>{lang.emoji}</span>
          <strong>{lang.name}</strong>
          <em> β€” {lang.level}</em>
        </li>
      ))}
    </ul>
  );
}

// Usage:
const data = [
  { id: 1, emoji: '🐍', name: 'Python',     level: 'Beginner' },
  { id: 2, emoji: 'βš›οΈ', name: 'React',      level: 'Intermediate' },
  { id: 3, emoji: 'πŸ¦€', name: 'Rust',       level: 'Advanced' },
];
// <LanguageList languages={data} />

πŸ“± Renders as

β€’ 🐍 Python β€” Beginner
β€’ βš›οΈ React β€” Intermediate
β€’ πŸ¦€ Rust β€” Advanced
Web front-end
βš›οΈ Web Front-End

Explore the Web Front-End category

React sits on top of JavaScript and works beautifully with TypeScript. Make sure you know JavaScript and HTML/CSS before diving deep into React.

Frequently Asked Questions

What is React?

React is a JavaScript library for building user interfaces, created by Facebook (Meta) and open-sourced in 2013. It uses a component-based architecture β€” you build your UI as a tree of reusable pieces β€” and a virtual DOM that efficiently updates only what changed on the page. It is the most popular frontend library in the world.

Do I need to know JavaScript before React?

Yes β€” React is built on JavaScript. You should be comfortable with JavaScript fundamentals: functions, arrays, objects, destructuring, arrow functions, and array methods like map() and filter(). If you are not there yet, complete our JavaScript tutorial first. A solid JS foundation makes React much easier to understand.

What are React hooks?

Hooks are functions that let you "hook into" React features from function components. The most important ones are useState (for managing state that changes) and useEffect (for side effects like fetching data or setting up subscriptions). Custom hooks let you extract and reuse stateful logic across multiple components.

React vs Vue vs Angular β€” which should I learn?

React is the most popular and has the largest ecosystem and job market. Vue is simpler to learn and has excellent documentation. Angular is a full framework used heavily in enterprise. For most new learners, React is the safest choice β€” it opens the most doors and the patterns transfer to React Native for mobile. All three are excellent choices.

What comes after learning React basics?

Next.js for server-side rendering and full-stack React apps, React Router for client-side navigation, Zustand or Redux for global state management, React Query for server state and data fetching, and Tailwind CSS for styling. In the job market, Next.js + TypeScript is currently the most in-demand React stack.

Ready to build with React?

Free. No signup. No downloads. Just start.

Start Learning React

No account required Β· Always free

The Story of React

Real history, real companies, and an honest look at where Reactshines and where it doesn't β€” not just a feature list.

πŸ•°οΈ

Where it came from

React was built inside Facebook by Jordan Walke and released publicly in 2013, originally to solve a real problem the Facebook News Feed team had: keeping a constantly changing, interactive UI in sync with underlying data without the app turning into unmaintainable spaghetti. Its core idea β€” describing UI as a function of state, and letting React figure out what actually changed on screen β€” was unusual at the time and is now industry standard.

🏒

How it’s actually used today

React (and its meta-framework Next.js) powers Facebook and Instagram themselves, along with Netflix's UI, Airbnb, Uber's dashboard tooling, and a large share of modern SaaS products. Because components are reusable, teams can build a design system once and reuse it across dozens of product screens.

βš–οΈ

Strengths & trade-offs

React's component model scales extremely well on large teams, but it's a library, not a full framework β€” you'll need to make (or adopt) decisions about routing, data fetching and state management that other frameworks like Angular bundle in by default. The ecosystem is enormous, which is a strength, but it also means there's more than one 'right' way to structure a project.

🧭

What to learn next

Most React developers pick up TypeScript alongside it fairly quickly for the safety it adds to larger component trees, and many move on to Next.js for server-side rendering, routing, and full-stack features once they're comfortable with plain React.