Bookmarks
ReferenceFrontendVerified

React

React is a library for building user interfaces from components. This reference covers JSX and props, hooks and state, effects, Actions, Server Components and React Compiler.

checked 1 Nov · next check 8 Nov · 52 min read

Sections
13
Reading
52 min
Current version
19.3.1
Written from
react.dev

Check status of the reference

Verified 1 Nov · next check 8 Nov

The sections were compared with the release notes, the check found nothing, and all source links respond.

  1. Verified
  2. Scheduled check

What React is and how it works

React is a JavaScript library for building user interfaces from components. You describe what the interface looks like for the current data, and React updates the page when the data changes.

React is useful wherever the interface changes in response to user actions and new data: forms, lists, filters, user accounts, single-page applications. React itself handles only the interface. Routing, data fetching and server rendering come from a framework, and the React team recommends starting a new project with one. Without a framework, you connect React to a bundler such as Vite and choose routing and data fetching yourself.

The interface is built from components arranged in a tree: the root component renders its children, and data flows down the tree through props. Every screen update goes through three steps. The trigger is the initial render or a call to a state’s set function. Render: React calls your components and works out what should be on the screen. Commit: React changes the DOM only where something differs; if the render result is the same, the DOM is left alone. Then the browser repaints the screen.

During render, React only calls your components; it changes the DOM during commit, and only where the result differs.

Rendering must be a pure calculation: given the same inputs, a component returns the same JSX and does not change objects or variables that existed before the render. Otherwise unpredictable bugs appear as the code grows. To make them visible, in StrictMode React calls every component twice during development. Side effects belong outside rendering: in event handlers, and synchronisation with external systems in effects (see the “Effects” section).

The component tree is not tied to a platform: in the browser it is rendered by react-dom, and on a phone by React Native, which uses native Android and iOS elements instead of HTML tags.

How it differs from Next.js and React Native

AspectReactNext.jsReact Native
What it isa UI librarya React framework for full-stack web applicationsa framework for Android and iOS apps built with React
What it providescomponents, state, hooksrouting, server and build-time rendering, Server Componentsaccess to platform APIs and native components
What the UI is made ofHTML elements: <div>, <button>HTML elements, with some of the HTML arriving ready-made from the server<View>, <Text>, <Image> — native views
Where it runsin the browseron the server and in the browser; can be exported as a static siteon the device

For a new web application, choose Next.js or another framework. Use React with a bundler if no framework fits or you are learning the basics. For mobile apps, use React Native, usually through the Expo framework. For details, see the Next.js and React Native references.

What you need to know first

  • JavaScript: functions and arrow functions, import and export modules, destructuring, the array methods map and filter — see the JavaScript reference.
  • HTML and CSS: tags, attributes, classes — see the HTML and CSS reference.
  • TypeScript is optional. The examples use JavaScript components (.jsx); in a TypeScript project you write them in .tsx files, and the TypeScript reference describes how to type props.

Section sources

the section is written from these pages

Cheat sheet

JSX syntax, hooks, built-in components and everyday commands. Replace the names in the examples (user, items, ThemeContext) with your own; each line is explained in its own section.

JSX

TaskHow to write it
Output a value<h1>{user.name}</h1>
Attribute from a variable<img src={user.avatarUrl} alt={user.name} />
CSS class<div className="card">
Style from a variable<div style={{ width: size }}>
One or the other{isLoggedIn ? <Profile /> : <Login />}
Show or render nothing{count > 0 && <Badge count={count} />}
List{items.map(item => <li key={item.id}>{item.title}</li>)}
Several elements without a wrapper<><h1>Title</h1><p>Text</p></>
Event handler<button onClick={handleClick}> — no parentheses after the name
Nested JSX<Card><Avatar /></Card>, inside Card it is the children prop

Hooks

TaskHook
A value that changes and re-renders the screenconst [count, setCount] = useState(0)
Complex update logic in one functionconst [state, dispatch] = useReducer(reducer, initial)
Synchronise with an external system after renderuseEffect(() => { … return cleanup; }, [deps])
Read the latest value in an effect without re-running itconst onTick = useEffectEvent(() => { … })
Data deep in the tree without propsconst theme = useContext(ThemeContext)
A value that does not re-render; DOM accessconst inputRef = useRef(null)
Cache a calculation or a functionuseMemo(() => calc(a), [a]), useCallback(fn, [deps])
Non-blocking update and a pending flagconst [isPending, startTransition] = useTransition()
Defer a heavy part of the UIconst deferredQuery = useDeferredValue(query)
Result and pending state of an Actionconst [state, formAction, isPending] = useActionState(fn, initial)
Show a result before the server respondsconst [optimistic, setOptimistic] = useOptimistic(value)
Submission status inside a form buttonconst { pending } = useFormStatus() from react-dom

Built-in components

ComponentPurpose
<>…</>, <Fragment key={id}>group elements without an extra DOM node
<Suspense fallback={<Spinner />}>show a fallback UI while child components load
<StrictMode>extra checks in development mode
<Activity mode="hidden">hide part of the UI while preserving its state

Commands

TaskCommand
Create a Next.js projectnpx create-next-app@latest
Create a Vite project with TypeScriptnpm create vite@latest my-app -- --template react-ts
Install dependenciesnpm install
Start the dev servernpm run dev
Build for productionnpm run build
Preview the production build locallynpm run preview
Install React Compiler for Vitenpm install -D babel-plugin-react-compiler@latest @rolldown/plugin-babel

Section sources

the section is written from these pages

Installation and first run

The official advice is to start a new React app with a framework such as Next.js; without a framework, create the project with the Vite bundler. Check the result in the browser: the Vite dev server serves the app at http://localhost:5173 by default.

Development requires Node.js: current Vite needs version 20.19+ or 22.12+, and some templates need a newer one. For how to install Node.js, see the Node.js reference.

With a framework

FrameworkCommandUse for
Next.js (App Router)npx create-next-app@latestfull-stack web applications
React Routernpx create-react-router@latestVite-based web applications
Exponpx create-expo-app@latestAndroid, iOS and web apps

A framework does not force you to run a server. All three can work as a single-page application and be exported as static files to a CDN, and you enable server rendering for individual routes when you need it. For more on Next.js, see the Next.js reference.

With the Vite bundler

Without a framework, start with a bundler: it provides a dev server for development and a build command for production. Routing, data fetching and server rendering are then chosen separately.

bashin the terminal
npm create vite@latest my-app -- --template react-tscd my-appnpm installnpm run dev

The --template flag selects a template: react-ts is React with TypeScript, react is plain JavaScript, and react-compiler-ts and react-compiler come with React Compiler already set up. Without the flag, create-vite asks you everything. npm needs the double hyphen -- to pass the flag on to create-vite.

Your first project

textreact-ts template
my-app/├── index.html       page with <div id="root">├── package.json     dependencies and npm scripts├── vite.config.ts   Vite settings and the React plugin├── tsconfig.json    TypeScript settings├── public/          site icon and other files└── src/    ├── main.tsx     entry point: createRoot    ├── App.tsx      root component    ├── assets/      images to import    ├── App.css    └── index.css

In Vite, index.html is the entry point: it loads src/main.tsx. There, createRoot finds the <div id="root"> element and hands control of it to React, and render displays the root component inside it. An app written entirely in React has one such call; from there the interface grows through nested components.

tsxsrc/main.tsx
import { StrictMode } from 'react';import { createRoot } from 'react-dom/client';import './index.css';import App from './App.tsx'; createRoot(document.getElementById('root')!).render(  <StrictMode>    <App />  </StrictMode>,);

Replace the contents of src/App.tsx with your own component and save the file — the page in the browser updates.

tsxsrc/App.tsx
export default function App() {  const name = 'Aziz';  return <h1>Hello, {name}!</h1>;}

To build for production, run npm run build; to check the build locally, run npm run preview.

If the page is blank

The error Target container is not a DOM element means createRoot received something that is not a DOM element: getElementById returned null. Check that the id in index.html matches what the code looks for, and that the script is loaded after that element. If there is no error but the screen is empty, check that render is called after createRoot.

React on an existing page

You do not have to rewrite the whole site. If React manages only part of the page, call createRoot for each such block, for example separately for the menu and for the comments. Each root renders its own component.

Section sources

the section is written from these pages

Components, JSX and props

A component is a JavaScript function that returns JSX markup; its name starts with a capital letter. A component receives data from its parent through props and only reads it. You build interfaces of any size from components, from a button to a whole page.

jsxProductCard.jsx
export default function ProductCard({ product, onAdd }) {  return (    <article className="card">      <h3>{product.title}</h3>      <p>{product.price} sum</p>      <button onClick={() => onAdd(product.id)}>        Add to cart      </button>    </article>  );}

export default makes the component the file’s main export; other modules import it like this: import ProductCard from './ProductCard.jsx'. The capital letter distinguishes the component <ProductCard /> from an HTML tag such as <article>: tags are lowercase.

JSX rules

  • One root element. Wrap several tags in a common parent or in a fragment <>…</>, which leaves no node in the DOM.
  • All tags are closed: <br />, <img />, <li>…</li>.
  • Set a CSS class with the className attribute, not class.
  • Curly braces switch into JavaScript: {product.title} in text, src={user.avatarUrl} in an attribute. Only a string can go in quotes.
  • A style is an object with camelCase property names: style={{ fontWeight: 'bold', width: 100 }}. React adds px to numbers unless the property is unitless (like opacity); for permanent styling, prefer className.
  • Write aria-* and data-* attributes with a hyphen, as in HTML; the for of a <label> is htmlFor.

Props

Props look like HTML attributes, but you can pass any JavaScript value through them: a string, number, object, array or function. The component receives them as a single object — its only argument — and usually destructures it right away. Set a default value directly in the destructuring.

jsxProfile.jsx
function Avatar({ person, size = 48 }) {  return (    <img      className="avatar"      src={person.imageUrl}      alt={person.name}      width={size}      height={size}    />  );} export default function Profile({ user }) {  // size is not passed, so it will be 48  return <Avatar person={user} />;}

A default value applies only if the prop is not passed or is undefined; it is not used for null or 0. A component receives the content between the opening and closing tags in the children prop — this is how wrappers work: cards, modal windows, layouts.

jsxUserCard.jsx
function Card({ children }) {  return <div className="card">{children}</div>;} export default function UserCard({ user }) {  return (    <Card>      <img src={user.imageUrl} alt={user.name} />      <h2>{user.name}</h2>    </Card>  );}

Props are read-only. A component does not change them: to show a different value, the parent passes new props. A value that changes in response to user actions is kept in state — see the “State” section.

Conditions

JSX has no special syntax for conditions; plain JavaScript works: if with return picks a whole branch, the ternary operator ? : and && embed directly in the markup, and return null renders nothing.

jsxHeader.jsx
export default function Header({ user, unread }) {  if (!user) {    return null;  }  return (    <header>      {user.isAdmin ? <AdminMenu /> : <UserMenu />}      {unread > 0 && <Badge count={unread} />}    </header>  );}

Lists and key

Render a list with the array method map, and filter out unwanted items first with filter. Each item needs a key — a string or number that is unique among its siblings. React uses the key to tell which item was inserted, removed or moved, and updates the DOM correctly.

jsxStockList.jsx
export default function StockList({ products }) {  const inStock = products.filter((p) => p.stocked);  return (    <ul>      {inStock.map((p) => (        <li key={p.id}>{p.title}</li>      ))}    </ul>  );}

Take the key from your data, for example a database id; for data created in the browser, use crypto.randomUUID() at the moment of creation. React falls back to the array index if you set no key, but with insertions, deletions and sorting it leads to hard-to-trace bugs. key={Math.random()} is even worse: elements and DOM are recreated on every render, and any text typed into them is lost. Without a key, React logs Each child in a list should have a unique “key” prop. to the console.

key is not passed as a prop: if you need the id inside the component, pass it separately — <Profile key={id} userId={id} />. If a list item consists of several nodes, use <Fragment key={id}>: the short <> syntax cannot take a key.

Events

Pass an event handler as a function: onClick={handleClick}. With parentheses — onClick={handleClick()} — the function runs immediately during render, not on click. If you need an argument, wrap the call in an arrow function: onClick={() => onAdd(product.id)}.

A component can receive a handler in its props: this is how a child tells its parent about an event while the data and state stay with the parent. Data flows down the tree, events flow up.

Solid arrows are props, which flow down; the dashed line is a handler call that travels up to the owner of the state.

Section sources

the section is written from these pages

State

State is a component’s memory: data that changes in response to user actions and must persist between renders. You declare it with the useState hook, and calling the update function asks React to render the component again with the new value.

jsxCounter.jsx
import { useState } from 'react'; export default function Counter() {  const [count, setCount] = useState(0);  return (    <button onClick={() => setCount(count + 1)}>      Clicked: {count}    </button>  );}

useState returns a pair: the current value and a set function that replaces it. The argument is the initial value; React ignores it after the first render. A regular variable will not work here: it does not survive a render, and changing it does not trigger a new one.

State is local and private. Two <Counter /> components on a page count independently, and a parent cannot read or change its child’s state. If values are only loosely related, use several state variables; the fields of one form are usually kept in a single object.

Hooks are functions whose names start with use. Call them only at the top level of a component or of your own hook: not inside conditions, loops or nested functions. React tells states apart by the order of the calls, so that order must not change from one render to the next.

State as a snapshot

Calling set does not change the variable in code that is already running: it queues a new render. Inside a handler, the value stays what it was when the render happened, even after an await or inside a setTimeout.

jsxhandler
function handleClick() {  setCount(count + 1);  setCount(count + 1);  // count is still the old value: the result is +1, not +2  console.log(count);}

To compute a new value from the previous one, pass an updater function to set. React queues it and applies it to the latest value.

jsxhandler
function handleClick() {  setCount((c) => c + 1);  // the result is +2: each updater receives the latest value  setCount((c) => c + 1);}

React batches updates: the screen is redrawn once, after the event handlers have finished. If the new value is the same as the current one according to Object.is, React skips the re-render.

Objects and arrays

State is read-only. Do not change an object or array in place; replace it with a new one: copy it with the ... syntax and change what you need. If you mutate an object and pass the same object to set, React considers the value unchanged and the screen does not update.

jsxhandlers
// object: a copy with a new fieldsetForm({ ...form, email: 'aziz@example.com' }); // array: add, change, removesetTodos([...todos, newTodo]);setTodos(todos.map((t) =>  t.id === id ? { ...t, done: true } : t,));setTodos(todos.filter((t) => t.id !== id));

Controlled inputs

An input whose value is set by state is called controlled: value comes from state, and onChange writes the typed text back to it. This way the value is always at hand for validation, display and submission.

jsxProfileForm.jsx
import { useState } from 'react'; export default function ProfileForm() {  const [form, setForm] = useState({ name: '', email: '' });   function handleChange(e) {    const { name, value } = e.target;    setForm({ ...form, [name]: value });  }   return (    <form>      <input        name="name"        value={form.name}        onChange={handleChange}      />      <input        name="email"        value={form.email}        onChange={handleChange}      />      <p>{form.name} ({form.email})</p>    </form>  );}

Where to keep state

If two components must change together, remove the state from both and lift it up to their closest common parent (lifting state up). The parent passes the value and handlers down to its children as props. Each value keeps a single owner, one source of truth, so copies of state in different components cannot drift apart.

jsxAccordion.jsx
import { useState } from 'react'; export default function Accordion() {  const [activeIndex, setActiveIndex] = useState(0);  return (    <>      <Panel        title="About us"        isActive={activeIndex === 0}        onShow={() => setActiveIndex(0)}      />      <Panel        title="Delivery"        isActive={activeIndex === 1}        onShow={() => setActiveIndex(1)}      />    </>  );} function Panel({ title, isActive, onShow }) {  return (    <section>      <h3>{title}</h3>      {isActive ? <p>Section text</p> : (        <button onClick={onShow}>Show</button>      )}    </section>  );}

useReducer for complex logic

When there are many updates scattered across handlers, gather the logic in a reducer: a function (state, action) => nextState. Handlers only say what happened, dispatch({ type: 'added', … }), and the reducer decides how the state changes. The reducer runs during rendering, so it must be pure: no requests, timers or mutations.

jsxTaskList.jsx
import { useReducer } from 'react'; function tasksReducer(tasks, action) {  switch (action.type) {    case 'added':      return [        ...tasks,        { id: action.id, text: action.text },      ];    case 'deleted':      return tasks.filter((t) => t.id !== action.id);    default:      throw Error('Unknown action: ' + action.type);  }} export default function TaskList() {  const [tasks, dispatch] = useReducer(tasksReducer, []);   function handleAdd() {    const id = crypto.randomUUID();    dispatch({ type: 'added', id, text: 'New task' });  }   return (    <>      <button onClick={handleAdd}>Add</button>      <ul>        {tasks.map((t) => (          <li key={t.id}>{t.text}</li>        ))}      </ul>    </>  );}

Reach for useReducer when a component keeps getting its state updates wrong: all the changes are visible in one place, and the reducer can be tested separately from the component. useState and useReducer are interchangeable, and you can combine them in one component.

Preserving and resetting state

State is tied to a component’s position on the screen, not to a line of code: as long as the same component is rendered at that position, React keeps its state. To reset state, give the component a different key; React will create it and all its descendants anew.

jsxChat.jsx
export default function Chat({ contact }) {  // a different contact means a new, empty form  return <MessageForm key={contact.id} contact={contact} />;}

Section sources

the section is written from these pages

Effects

An Effect is code that React runs after a render has been committed, to synchronise a component with an external system: a network connection, a subscription, a timer, a non-React widget. If there is no external system and you only need to compute data from props and state, you do not need an Effect.

jsxChatRoom.jsx
import { useEffect } from 'react';import { createConnection } from './chat.js'; export default function ChatRoom({ roomId }) {  useEffect(() => {    const connection = createConnection(roomId);    connection.connect();    return () => connection.disconnect();  }, [roomId]);   return <h1>Room {roomId}</h1>;}

An Effect has three parts. The setup function connects; the cleanup function that setup returns disconnects; the dependencies array says when to reconnect. When dependencies change, React first calls cleanup with the old values, then setup with the new ones, and after the component is removed it calls cleanup one last time.

The dependencies array

FormWhen the Effect runs
useEffect(fn)after every render
useEffect(fn, [])only on mount, when the component appears on the screen
useEffect(fn, [a, b])on mount and after a render in which a or b has changed

You do not choose dependencies at will: the array must contain every reactive value used in the Effect’s code, meaning props, state, and variables and functions declared in the component body. React compares them with Object.is. The eslint-plugin-react-hooks linter checks the list and reports errors such as React Hook useEffect has a missing dependency: 'isPlaying'. To stop an Effect from re-running, change its code, not the list. Refs and the set functions from useState are stable and can be omitted.

Lifecycle and cleanup

An Effect’s lifecycle is not the same as a component’s. An Effect can only start synchronising and stop synchronising, and this can repeat many times while the component is on the screen. When roomId changes, React disconnects from the old room and connects to the new one; when the component is removed, it disconnects for good.

This is how an Effect lives in production; in development, StrictMode adds one extra setup and cleanup cycle right after mounting.

Cleanup must undo what setup did: unsubscribe from an event, call clearInterval, close a connection or dialog, or reset an animation to its initial state.

jsxsubscription with cleanup
useEffect(() => {  function handleScroll() {    console.log(window.scrollY);  }  window.addEventListener('scroll', handleScroll);  return () => {    window.removeEventListener('scroll', handleScroll);  };}, []);

Double invocation in development

In development, in StrictMode, React runs one extra cleanup and setup right after mounting. This checks that cleanup mirrors setup: the user should see no difference between a single run and the sequence setup → cleanup → setup. In production, the Effect runs once. Do not hide the second run behind a flag in a ref; write the missing cleanup instead.

Fetching data in an Effect

If an Effect fetches data, cleanup must cancel the request or ignore its response. Otherwise the response to an old request can arrive after a newer one and overwrite the data.

jsxUserProfile.jsx
useEffect(() => {  let ignore = false;  async function load() {    const res = await fetch(`/api/users/${userId}`);    const user = await res.json();    if (!ignore) {      setUser(user);    }  }  load();  return () => {    ignore = true;  };}, [userId]);

Instead of a flag, you can cancel the request itself with AbortController: pass its signal to fetch and call abort() in cleanup. Fetching in Effects has a cost: Effects do not run on the server, and requests from a parent and its children line up in a “waterfall”. In a framework, use its built-in data fetching; without one, use a library with a cache: TanStack Query, SWR or React Router.

When you do not need an Effect

TaskInstead of an Effect
Compute data from props and state: filter a list, join a nameCalculate it directly during rendering and do not store the result in state; wrap an expensive calculation in useMemo
Reset all state when a prop changesPass a different key: <Profile key={userId} />
Respond to a user action: a purchase, a form submissionWrite the code in an event handler
Synchronise the state of several componentsLift the state up to a common parent

The rule: code that must run because the component appeared on the screen belongs in an Effect; everything else belongs in event handlers.

useEffectEvent: fresh values without re-running

Sometimes an Effect needs to read a current value, but changing that value should not reconnect: for example, the theme used in a notification. Move such logic into an Effect Event: useEffectEvent returns a function that always sees the latest props and state and is not part of the dependencies.

jsxChatRoom.jsx
import { useEffect, useEffectEvent } from 'react';import { createConnection } from './chat.js';import { showNotification } from './notifications.js'; export default function ChatRoom({ roomId, theme }) {  const onConnected = useEffectEvent(() => {    showNotification('Connected', theme);  });   useEffect(() => {    const connection = createConnection(roomId);    connection.on('connected', onConnected);    connection.connect();    return () => connection.disconnect();  }, [roomId]);   return <h1>Room {roomId}</h1>;}

Call an Effect Event only from inside Effects: do not pass it to other components, and do not use it to hide dependencies that should re-run the Effect.

Section sources

the section is written from these pages

Context

Context passes data to every component below it in the tree without props at each level. A component higher up sets the value, and any descendant reads it with the useContext hook. This is how you pass the theme, the current user or application state.

jsxApp.jsx
import { createContext, useContext, useState } from 'react'; // the default value is used if there is no provider aboveconst ThemeContext = createContext('light'); export default function App() {  const [theme, setTheme] = useState('dark');  return (    <ThemeContext value={theme}>      <Toolbar />      <button onClick={() => setTheme('light')}>        Light theme      </button>    </ThemeContext>  );} function Toolbar() {  return <Button>Save</Button>;} function Button({ children }) {  const theme = useContext(ThemeContext);  return <button className={theme}>{children}</button>;}

There are three steps: createContext outside any component creates the context, <ThemeContext value={…}> sets the value for the whole subtree, and useContext(ThemeContext) reads the value of the closest provider above. Since React 19, the context itself acts as the provider; <ThemeContext.Provider> is the older syntax. Toolbar knows nothing about the theme: the value passes through it without props.

The default value from createContext is used only if there is no provider above at all. A provider without value passes undefined, and a provider in the same component that calls useContext has no effect: it must be higher in the tree.

When you need context

Context suits data that components in different parts of the tree need: the theme, the current account, the current route (this is how routing libraries work), shared application state.

Before reaching for context, try two simpler options. The first is to pass props explicitly: even a dozen of them make it clear which components use which data. The second is to extract components and pass JSX as children: <Layout><Posts posts={posts} /></Layout> instead of <Layout posts={posts} />, if Layout does not display the posts itself.

Context and a reducer

For application state, context is combined with useReducer: one context passes the state, another passes the dispatch function. Any component below reads the data and sends actions without receiving them through props. Keep the whole arrangement in one file and export your own hooks from it.

jsxTasksContext.jsx
import { createContext, useContext, useReducer } from 'react';import { tasksReducer } from './tasksReducer.js'; const TasksContext = createContext(null);const TasksDispatchContext = createContext(null); export function TasksProvider({ children }) {  const [tasks, dispatch] = useReducer(tasksReducer, []);  return (    <TasksContext value={tasks}>      <TasksDispatchContext value={dispatch}>        {children}      </TasksDispatchContext>    </TasksContext>  );} export function useTasks() {  return useContext(TasksContext);} export function useTasksDispatch() {  return useContext(TasksDispatchContext);}

Wrap the application in <TasksProvider>, and in any component inside it you only need to call useTasks() or useTasksDispatch().

Re-renders when the value changes

When a provider receives a new value (React compares with Object.is), every component that reads this context re-renders, and memo does not prevent it. If the value is an object or function created during rendering, it is new on every re-render of the provider.

jsxAuthProvider.jsx
import {  createContext,  useCallback,  useMemo,  useState,} from 'react'; export const AuthContext = createContext(null); export function AuthProvider({ children }) {  const [currentUser, setCurrentUser] = useState(null);  const login = useCallback((user) => {    setCurrentUser(user);  }, []);  const value = useMemo(    () => ({ currentUser, login }),    [currentUser, login],  );  return (    <AuthContext value={value}>{children}</AuthContext>  );}

With useMemo and useCallback, readers of AuthContext re-render only when currentUser changes. In small applications, extra re-renders are usually unnoticeable, so this optimisation is not required.

Section sources

the section is written from these pages

Refs and DOM access

A ref is an object { current } that React keeps between renders; changing current does not trigger a re-render. Refs hold values that do not affect the output, such as a timer ID or an external object, and give you access to a DOM element for focus, scrolling or measurements.

jsxStopwatch.jsx
import { useRef, useState } from 'react'; export default function Stopwatch() {  const [seconds, setSeconds] = useState(0);  const intervalRef = useRef(null);   function start() {    clearInterval(intervalRef.current);    intervalRef.current = setInterval(() => {      setSeconds((s) => s + 1);    }, 1000);  }   function stop() {    clearInterval(intervalRef.current);  }   return (    <>      <p>{seconds} s</p>      <button onClick={start}>Start</button>      <button onClick={stop}>Stop</button>    </>  );}

The seconds are shown on the screen, so they are state. The interval ID is needed only by the handlers, so it lives in a ref: changing it should not re-render the component.

PropertyRef (useRef)State (useState)
Returns{ current: initialValue }[value, setValue]
Changing itdoes not trigger a re-rendertriggers a re-render
How to changeassign to ref.current outside renderingonly through the set function
Reading during renderingnot allowedallowed; each render has its own snapshot

Accessing the DOM

Pass a ref to a tag’s ref attribute: React puts the DOM node in ref.current when it creates it, and null when the node is removed. You work with the node in event handlers and Effects.

jsxSearchBox.jsx
import { useRef } from 'react'; export default function SearchBox() {  const inputRef = useRef(null);  return (    <>      <input ref={inputRef} placeholder="Search" />      <button onClick={() => inputRef.current.focus()}>        Go to search      </button>    </>  );}

In the same way you call scrollIntoView() to scroll to an element, or any other browser DOM method.

A ref as a regular prop

In React 19, you pass a ref to your own component like any other prop, and the component attaches it to the right tag. forwardRef is no longer needed for this; it will be deprecated in future versions.

jsxForm.jsx
import { useRef } from 'react'; function MyInput({ ref, ...props }) {  return <input ref={ref} {...props} />;} export default function Form() {  const inputRef = useRef(null);  return <MyInput ref={inputRef} placeholder="Name" />;}

Ref callbacks

Instead of an object, you can pass a function to ref. React calls it with the DOM node when the node appears, and calls the cleanup function it returns when the node is removed. This is how you keep refs to list items, for example in a Map keyed by ID.

jsxCatList.jsx
import { useRef } from 'react'; export default function CatList({ cats }) {  const itemsRef = useRef(new Map());  return (    <ul>      {cats.map((cat) => (        <li          key={cat.id}          ref={(node) => {            itemsRef.current.set(cat.id, node);            return () => itemsRef.current.delete(cat.id);          }}        >          {cat.name}        </li>      ))}    </ul>  );}

Now you can scroll to any cat: itemsRef.current.get(id).scrollIntoView().

Since React 19.3, you can also pass a ref to an explicit <Fragment ref={…}>. It receives a FragmentInstance: focus, event handlers, IntersectionObserver and ResizeObserver for all child nodes at once, without a wrapper <div>. The short <> syntax cannot take a ref.

What not to do

Do not read or write ref.current during rendering. The exception is lazy initialisation, if (!ref.current) ref.current = new Thing(). React does not know when current changes, so a render that depends on it becomes unpredictable. If the value is needed for the output, it is state.

Section sources

the section is written from these pages

Actions and forms

An Action is a function that React runs inside a transition, often an async one: submitting a form, calling an API. While the Action runs, React tracks the pending state for you and passes any exception to the nearest Error Boundary.

Transition: useTransition

startTransition marks updates as non-blocking: the interface stays responsive, and such an update is interrupted if the user, say, starts typing. The function you pass to startTransition is called an Action. isPending tells you the transition is still in progress.

jsxSaveButton.jsx
import { useTransition } from 'react'; export default function SaveButton({ saveAction }) {  const [isPending, startTransition] = useTransition();  return (    <button      disabled={isPending}      onClick={() => {        startTransition(async () => {          await saveAction();        });      }}    >      {isPending ? 'Saving…' : 'Save'}    </button>  );}

A form with an action

Pass a function to the action prop of <form>. React calls it on submit and hands it a FormData object with the form fields keyed by name. You do not need to call e.preventDefault(): the submission runs in a transition, and after it succeeds React resets uncontrolled fields.

jsxSearch.jsx
export default function Search() {  function search(formData) {    const query = formData.get('query');    alert(`Searching for: ${query}`);  }  return (    <form action={search}>      <input name="query" />      <button type="submit">Search</button>    </form>  );}

An onSubmit handler works in any version of React. But only with action does a form get a pending state, integration with useActionState and useOptimistic, and the ability to call a Server Function. If action is a function, the form is submitted with POST regardless of method.

Result and error: useActionState

useActionState stores the result of the last Action. You give it a function (prevState, payload) => newState and an initial state. Unlike a reducer, the function can be async and make requests. The hook returns the current state, a function to trigger the Action, and an isPending flag; in a form, the function receives FormData as its second argument.

Return expected errors, such as “out of stock” or validation errors, as part of the state and show them in the interface. If you throw an exception, React cancels all queued Actions and shows the nearest Error Boundary.

Pending state in a button: useFormStatus

useFormStatus from react-dom returns the state of the parent form: pending, the data being submitted, method and action. The hook works only in a component rendered inside a <form> and does not see a form rendered by the same component, so the submit button goes into a separate component.

jsxSendButton.jsx
import { useFormStatus } from 'react-dom'; export default function SendButton() {  const { pending } = useFormStatus();  return (    <button type="submit" disabled={pending}>      {pending ? 'Sending…' : 'Send'}    </button>  );}

Optimistic update: useOptimistic

An optimistic update shows the expected result immediately, before the server responds. useOptimistic(value) returns a value and a function that sets it for the duration of an Action. While the Action runs, the hook returns the optimistic value; once it finishes, it returns value again. If the request fails, the parent does not update value and the interface reverts on its own; show the error message separately.

As a second argument you can pass a reducer (current, action) => next, which computes the optimistic value from the current one, for example by adding an item to a list. Call the function returned by useOptimistic only inside an Action, in a transition or in a form’s action; otherwise React logs a warning.

Worked example: comments

A comment form using all three hooks: the button shows the pending state, a new comment appears immediately marked “sending…”, and a server error is shown below the list. saveComment is your API request function: it returns the saved comment { id, text } or throws.

javascriptaddComment.js
import { saveComment } from './api.js'; export async function addComment(prev, formData) {  try {    const saved = await saveComment(formData.get('text'));    const comments = [...prev.comments, saved];    return { comments, error: null };  } catch {    return { ...prev, error: 'Comment was not saved' };  }}
jsxComments.jsx
import { useActionState, useOptimistic } from 'react';import { addComment } from './addComment.js';import SendButton from './SendButton.jsx'; export default function Comments({ initial }) {  const [state, dispatch] = useActionState(addComment, {    comments: initial,    error: null,  });  const [shown, addShown] = useOptimistic(    state.comments,    (list, item) => [...list, item],  );   async function formAction(formData) {    const text = formData.get('text');    const id = crypto.randomUUID();    addShown({ id, text, sending: true });    return dispatch(formData);  }   return (    <>      <ul>        {shown.map((c) => (          <li key={c.id}>            {c.text}            {c.sending && <small> sending…</small>}          </li>        ))}      </ul>      {state.error && <p role="alert">{state.error}</p>}      <form action={formAction}>        <input name="text" required />        <SendButton />      </form>    </>  );}

How it works. formAction is passed to the form’s action, so it is an Action, and calling addShown inside it is allowed. The comment with sending: true is visible while addComment waits for the response. When that function returns the new state, the list is built from state.comments. On an error, the optimistic comment disappears by itself and the error text arrives in state.error. SendButton learns about the submission through useFormStatus, with no props.

Section sources

the section is written from these pages

Server Components and Server Functions

Server Components are components that run ahead of time, separately from the browser: once at build time, or on the server for each request. Their code is not included in the JavaScript the browser downloads, and they can be async and read files and databases directly.

They work only in a framework or bundler that supports React Server Components (RSC). The files, routes and cache that make this work in Next.js are covered in the Next.js reference; this section covers React’s own model.

jsxNote.jsx, server
import db from './database.js'; export default async function Note({ id }) {  // data is read right during render, with no separate API  const note = await db.notes.get(id);  return (    <article>      <h1>{note.title}</h1>      <p>{note.body}</p>    </article>  );}

Server Components have no state and no event handlers, and most hooks are unavailable to them, because their code is never sent to the browser. To add interactivity, nest Client Components inside them. There is no directive for Server Components: 'use server' marks Server Functions, not components.

The 'use client' boundary

The 'use client' directive at the top of a file marks the module and everything it imports as client code, which will be sent to the browser. The boundary follows the import tree, not the render tree. A Server Component can pass JSX to a Client Component as children, and that JSX stays server-rendered.

The boundary follows imports: everything a module with 'use client' imports also becomes client code.
jsxCounter.jsx, client
'use client'; import { useState } from 'react'; export default function Counter() {  const [count, setCount] = useState(0);  return (    <button onClick={() => setCount(count + 1)}>      {count}    </button>  );}
jsxProductList.jsx, server
import db from './database.js';import Counter from './Counter.jsx'; export default async function ProductList() {  const products = await db.products.getAll();  return products.map((p) => (    <div key={p.id}>      {p.title} <Counter />    </div>  ));}

Write 'use client' at the very top of the file, before any imports, in single or double quotes. Props that a Server Component passes to a Client Component must be serialisable: primitives, arrays, Map, Set, Date, plain objects, promises, JSX and Server Functions. Regular functions, classes and class instances cannot be passed.

Server Functions and 'use server'

A Server Function is an async function that runs on the server but is called from client code. Mark it with the 'use server' directive at the top of the function or file. The framework gives the client a reference to it, and when it is called, React sends a request to the server and returns the result. Server Functions are meant for mutations on the server; using them to fetch data is not recommended.

javascriptactions.js
'use server'; import { getUser } from './auth.js';import db from './database.js'; export async function addToCart(formData) {  // arguments come from the client: validate everything  const user = await getUser();  if (!user) {    throw new Error('Sign-in required');  }  const productId = String(formData.get('productId'));  await db.cart.add(user.id, productId);}
jsxAddToCart.jsx, client
'use client'; import { addToCart } from './actions.js'; export default function AddToCart({ productId }) {  return (    <form action={addToCart}>      <input        type="hidden"        name="productId"        value={productId}      />      <button type="submit">Add to cart</button>    </form>  );}

A Client Component imports a Server Function from a file with 'use server' and passes it to a form’s action. After a successful submission React resets the form; useActionState provides the pending state and the latest response. The arguments and the result of a Server Function must also be serialisable, and the function itself must be async.

Section sources

the section is written from these pages

Performance and React Compiler

When a component’s state changes, React re-renders it and all its descendants unless they are memoised. This is usually fast enough. When it is not, React Compiler adds memoisation at build time, and for heavy updates there are useDeferredValue, lazy and <Activity>.

React Compiler

React Compiler is a build tool that adds memoisation automatically: it caches the results of rendering and calculations in components and hooks and reuses them. You do not need to rewrite your code, because the compiler understands the rules of React. It is stable, works best with React 19 and supports 17 and 18.

The compiler removes cascading re-renders (when a parent updates, it does not re-render children that have not changed) and caches expensive calculations during render. It does not memoise regular functions outside components and hooks, and each component has its own cache.

Enabling it in Vite

bashin the project directory
npm install -D babel-plugin-react-compiler@latestnpm install -D @rolldown/plugin-babel
typescriptvite.config.ts
import { defineConfig } from 'vite';import react, { reactCompilerPreset } from '@vitejs/plugin-react';import babel from '@rolldown/plugin-babel'; export default defineConfig({  plugins: [    react(),    babel({ presets: [reactCompilerPreset()] }),  ],});

This is how to enable the compiler with @vitejs/plugin-react version 6.0.0 or later. With Babel, add babel-plugin-react-compiler first in the plugin list of babel.config.js; in Next.js the compiler is enabled through its configuration (since Next.js 15.3.1).

To check, look for the “Memo ✨” badge on optimised components in React DevTools. If a component breaks after compilation, temporarily exclude it with the 'use no memo' directive at the start of the function. Code the compiler cannot optimise is flagged by the eslint-plugin-react-hooks rules from the recommended-latest preset.

memo, useMemo and useCallback

Without the compiler, you write memoisation by hand: memo skips re-rendering a component when its props are the same, useMemo caches the result of a calculation, and useCallback caches a function that you pass to a memoised child.

jsxShop.jsx
import { memo, useCallback, useMemo } from 'react'; const Table = memo(function Table({ rows, onSelect }) {  return rows.map((r) => (    <Row key={r.id} row={r} onSelect={onSelect} />  ));}); export default function Shop({ products, query }) {  const rows = useMemo(    () => products.filter((p) => p.title.includes(query)),    [products, query],  );  const handleSelect = useCallback((id) => {    console.log('selected', id);  }, []);  return <Table rows={rows} onSelect={handleSelect} />;}

With the compiler, write new code without manual memoisation. Keep useMemo and useCallback where you need precise control, for example when a value is an effect dependency and must not change without reason. Do not remove existing memoisation without testing, as it changes the compiler’s output. Before complicating your code, measure whether the calculation is actually expensive.

useDeferredValue for search and long lists

If part of the interface re-renders slowly on every keystroke, defer it. useDeferredValue first renders with the old value and then re-renders in the background with the new one. The background render is interrupted by new input, so the field stays responsive while the list catches up.

jsxSearch.jsx
import { useDeferredValue, useState } from 'react';// SlowList is wrapped in memoimport SlowList from './SlowList.jsx'; export default function Search() {  const [text, setText] = useState('');  const deferredText = useDeferredValue(text);  return (    <>      <input        value={text}        onChange={(e) => setText(e.target.value)}      />      <SlowList text={deferredText} />    </>  );}

useDeferredValue has no fixed delay and does not reduce the number of network requests. If an update is already running in a transition (startTransition), the hook returns the new value immediately: it is deferred anyway.

Code splitting: lazy and Suspense

lazy defers loading a component’s code until it is first rendered. While the code loads, the nearest <Suspense> boundary shows the fallback from fallback. The component must be a default export, and showing an already loaded component again involves no waiting.

jsxReport.jsx
import { lazy, Suspense, useState } from 'react'; // at module top level, not inside a componentconst Chart = lazy(() => import('./Chart.jsx')); export default function Report() {  const [show, setShow] = useState(false);  return (    <>      <button onClick={() => setShow(true)}>Chart</button>      {show && (        <Suspense fallback={<p>Loading…</p>}>          <Chart />        </Suspense>      )}    </>  );}

A lazy declared inside a component is created anew on every render, and the loaded component’s state is reset.

Activity: hide while keeping state

<Activity mode="hidden"> hides part of the interface with display: none but does not unmount it. State and DOM, such as text typed into a <textarea>, are preserved, while effects are destroyed and created again when it is shown. The hidden part renders at low priority and can prepare the code and data of the tab that will be opened next.

jsxTabs.jsx
import { Activity, useState } from 'react'; export default function Tabs() {  const [tab, setTab] = useState('home');   function mode(name) {    return tab === name ? 'visible' : 'hidden';  }   return (    <>      <button onClick={() => setTab('home')}>        Home      </button>      <button onClick={() => setTab('contact')}>        Contact      </button>      <Activity mode={mode('home')}>        <Home />      </Activity>      <Activity mode={mode('contact')}>        <Contact />      </Activity>    </>  );}

Section sources

the section is written from these pages

Common errors and diagnostics

Start with the browser console in development mode: React logs errors and warnings there. React Developer Tools shows the component tree with props and state. Remember that in development, StrictMode deliberately calls components twice and re-runs effects.

Order of checks

  1. Read the console error in full and expand the call stack: it leads to the line where the problem arose, for example the relevant set call.
  2. In the Components tab of React DevTools, find the component and check its props and state; you can change them right there.
  3. Check the rules of React: components and hooks are pure, props and state are not mutated, and hooks are called at the top level. StrictMode and eslint-plugin-react-hooks catch violations.
  4. If the interface is slow, record the interaction in the Profiler tab of React DevTools.

React Developer Tools installs as an extension for Chrome, Firefox and Edge. For Safari and other browsers there is a standalone app from npm: run it and connect your site with the tag <script src="http://localhost:8097"></script> at the start of <head>.

bashin the terminal
npm install -g react-devtoolsreact-devtools

Too many re-renders

Cause: state is changed unconditionally during render, and the component loops: render, set, render. Most often a handler is called instead of being passed. Full message: Too many re-renders. React limits the number of renders to prevent an infinite loop.

jsxfix
// wrong: handleClick is called during renderreturn <button onClick={handleClick()}>Buy</button>; // right: pass the functionreturn <button onClick={handleClick}>Buy</button>;// right: pass an arrow functionreturn <button onClick={(e) => handleClick(e)}>Buy</button>;

Hook called in a condition, loop or after return

Cause: the rules of hooks are broken. Call hooks only at the top level of a component or your own hook, before any early return. Do not call them in conditions, loops, nested functions (including handlers) or regular JavaScript functions.

jsxfix
// wrong: after an early return, the hook is not always calledfunction Profile({ user }) {  if (!user) return null;  const [tab, setTab] = useState('posts');  // ...} // right: hooks first, then conditionsfunction Profile({ user }) {  const [tab, setTab] = useState('posts');  if (!user) return null;  // ...}

Value did not change right after set

Cause: state is a snapshot. set asks React for a new render but does not change the variable in the handler that is already running, even in setTimeout. If you need the new value straight away, store it in a variable.

jsxfix
const nextCount = count + 1;setCount(nextCount);// count is still the old value here, nextCount is the new oneconsole.log(count, nextCount);

Screen did not update after changing an object

Cause: the object or array was changed in place and the same object was passed to set. React compares values with Object.is, sees the same one and skips the update.

jsxfix
// wrong: mutation, React will not see the changeobj.x = 10;setObj(obj); // right: a new objectsetObj({ ...obj, x: 10 });

Effect runs twice on mount

Cause: in development, StrictMode runs an extra setup and cleanup once to check your cleanup. In production the effect runs once.

  • Add cleanup that reverses the setup: an unsubscribe, clearInterval, disconnect().
  • Compare the outcomes: after the sequence setup → cleanup → setup, everything should work the same as after a single setup.
  • If the double run is visible on screen, the cleanup is missing some logic.

Effect restarts endlessly

Cause: the effect changes state, and that change alters one of its dependencies, often an object or function that is recreated on every render. Log the dependencies to the console and compare them between renders with Object.is.

jsxcheck
useEffect(() => {  // ...}, [serverUrl, roomId]);// which dependency is new on every render?console.log([serverUrl, roomId]);
  • If there is no external system, remove the effect and calculate the value during render.
  • Create objects and functions inside the effect, not in the component body.
  • Update state with an updater function: setCount((c) => c + 1), so count is not needed in the dependencies.
  • Keep data that is not shown on screen in a ref: changing it does not trigger a render.
  • As a last resort, memoise the dependency with useMemo or useCallback.

Hydration mismatch

Cause: the HTML from the server and the first render in the browser differ, while during hydration hydrateRoot expects identical output. In development React warns about this in the console. Common sources: a typeof window !== 'undefined' check during render, browser APIs such as window.matchMedia, different data on the server and in the browser, and extra spaces and line breaks around the root element.

  • Make the first render identical, and show anything that exists only in the browser after hydration.
  • If a component has nothing to show on the server, defer it to the browser with use(browser()) from react-dom rather than with an effect.
  • For an unavoidable difference in a single element, such as the time, add suppressHydrationWarning={true}: it works one level deep.
  • Fix these errors as bugs: in the worst case, event handlers end up attached to the wrong elements.

Flicker before an effect runs

Cause: after actions not triggered by a click, useEffect runs after the browser has painted, and the user may see an intermediate state, such as a tooltip in the wrong place. If the effect must run before painting, replace useEffect with useLayoutEffect; most effects do not need this.

Minor issues

SymptomCauseWhat to do
A function in state is called instead of being storedReact treats a function in useState as an initialiser, and in set as an updaterWrap it: useState(() => fn), setFn(() => next)
The initialiser or updater runs twiceStrictMode checks that they are pureRemove mutations: return a new array instead of using push
Effect cleanup runs without an unmountCleanup also runs before every restart with new dependenciesMake the cleanup mirror the setup
The effect reads a stale valueThe value is missing from the dependenciesAdd it to the array or move the read into useEffectEvent
A component re-renders too oftenThe descendants of an updated component re-renderFind the culprit in the Profiler tab; for ways to fix it, see the section “Performance and React Compiler”

Section sources

the section is written from these pages

Versions and what’s new

This reference covers React 19.3. The latest release is 19.3.1, published on 14 October 2026. react.dev hosts the documentation for the latest major version, while documentation for earlier ones moves to archive subdomains such as 18.react.dev.

BranchStatusFirst releaseLatest release
19.3covered here, current9 September 202619.3.1 — 14 October 2026
19.2receives security fixesOctober 202519.2.9 — 14 October 2026
19.1receives security fixesMarch 202519.1.10 — 14 October 2026
19.0receives security fixesDecember 202419.0.9 — 14 October 2026
18.3previous major version, documentation at 18.react.devApril 202418.3.1 — April 2024

React does not publish support periods for its branches. The releases show that security patches currently ship at the same time for all 19.x branches, so update at least to the latest patch of your branch.

What changed in 19.3

  • Refs and DOM access: a ref on <Fragment> gives a FragmentInstance — focus, event listeners and observers for a whole group of child nodes at once, with no wrapper.
  • Actions and forms: <ViewTransition> and addTransitionType are now stable — React animates parts of the UI appearing, disappearing and changing during updates inside a transition.
  • Actions and forms: transitions render independently, so a slow transition no longer holds back the others.
  • Common errors and diagnostics: use(browser()) from react-dom disables server rendering of a component — the HTML contains the fallback of the nearest <Suspense>.
  • Components, JSX and props: support for Trusted Types — TrustedHTML passed to dangerouslySetInnerHTML is no longer converted to a string.
  • Server Components and Server Functions: a Server Component can render a context from a 'use client' module directly, without a wrapper component.
  • Effects: in StrictMode, effects are also called twice during hydration, as they are in a normal browser render.

Deprecated and removed

  • forwardRef is no longer needed: in React 19, ref is a regular prop. Reading element.ref is deprecated; use element.props.ref instead.
  • propTypes were removed in 19.0: the checks are silently ignored, so use TypeScript for types. defaultProps on function components were removed too — set default values in destructuring.
  • String refs in class components were removed — use callback refs.
  • ReactDOM.render and ReactDOM.hydrate were removed — use createRoot and hydrateRoot; use root.unmount() instead of unmountComponentAtNode.
  • findDOMNode was removed — use refs on DOM elements.
  • Legacy context based on contextTypes and getChildContext was removed — use createContext.
  • react-test-renderer is deprecated — for tests, use a modern library such as React Testing Library.
  • React 19 requires the new JSX transform; without it, the console shows Your app (or one of its dependencies) is using an outdated JSX transform.

Security updates

All vulnerabilities over the past year are in the Server Components packages react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack. They do not affect an app if its React code does not run on the server, or if the app does not use a framework, bundler or plugin that supports Server Components.

IdentifierWhat is affectedFixed in
GHSA-xqc2-xf4c-x3h3Server Components: unauthenticated remote code execution, critical19.0.9, 19.1.10, 19.2.9, 19.3.1
GHSA-h3gv-c5rc-p453Server Functions: denial of service — memory exhaustion or CPU load19.0.9, 19.1.10, 19.2.9, 19.3.1
CVE-2026-44907Server Functions: denial of service19.0.8, 19.1.9, 19.2.8
CVE-2026-23870Server Components: denial of service19.0.6, 19.1.7, 19.2.6
CVE-2026-23869Server Components: CPU load of up to a minute per request19.0.5, 19.1.6, 19.2.5
CVE-2026-23864, CVE-2025-67779, CVE-2025-55184Server Functions: denial of service; the first fixes were incomplete19.0.4, 19.1.5, 19.2.4
CVE-2025-55183Server Functions: disclosure of Server Function source code19.0.2, 19.1.3, 19.2.2
CVE-2025-55182Server Components: unauthenticated remote code execution, critical19.0.1, 19.1.2, 19.2.1

Section sources

the section is written from these pages

End of the reference

What changed

revision history · 4 entries

Every edit is saved as a revision: a snapshot of the reference, the reason and a summary of changes. The published version changes only after the same checks as at creation.

  1. Manual edit

    reason: manual edit
  2. Manual edit

    reason: manual edit
  3. Manual edit

    reason: manual edit
  4. Reference updated

Weekly check

How the reference is checked

Once a week — and right after news of a release or a vulnerability — the reference is checked in three steps.

  1. 1. Freshness

    Sections are compared with the release notes and changelogs from the official sources and with the topic’s news.

  2. 2. Errors

    Every section is read again: wrong facts, outdated APIs and flags, broken examples.

  3. 3. Links — by an HTTP request

    Every source link must respond. A broken link is a reason to recheck the section.

No findings — only the date changes. Findings — only the affected sections are rewritten, and they appear in “What changed”. A new version replaces the published one only after passing the same checks as at creation.

Statuses

Verified
no findings
Updated
sections rewritten, edits are listed
Rechecking
while the check runs, the previous version stays open
Needs review
disputed points: the verified version is shown, editors review

Last check

18 Nov · Check · updated · no findings

Found an error in the reference?

On the topic

tracks, news and other references
The whole “React” topic
13 sections
Another reference · Backend

HTTP and REST

Verified 1 Nov
All references · 61