Digital Garden

React

Core concepts and patterns for building UIs with React.

React Fundamentals

React is a JavaScript library for building user interfaces using components.

Components

Components let you split the UI into independent, reusable pieces:

function Welcome({ name }: { name: string }) {
  return <h1>Hello, {name}!</h1>;
}

Hooks

Hooks let you use state and other React features without writing classes:

import { useState } from "react";

function Counter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount((c) => c + 1)}>Count: {count}</button>;
}

Further Reading

Explore component composition, context, and performance optimizations as next steps.