React Reference

Last updated: 2026-11-02

React Reference

Alphabetical list of 80 React entries: core concepts, rendering & state, component patterns, effects & performance, routing & state management, data & engineering, ecosystem — each with syntax, a live example and an online editor.

A
AbortControllerAbortController is a native browser API: pass its signal to fetch and call abort() to canc...
Action DesignAn action is a plain object describing what happened: its type is the identity, usually an...
B
BrowserRouterBrowserRouter is the routing container of react-router-dom: it watches the address and pro...
C
Callback PropsProps can carry functions as well as data. A child calls the callback the parent passed in...
childrenchildren is a special prop: whatever sits between a component's opening and closing tags a...
Cleanup FunctionThe cleanup function is the teardown returned by an effect: it runs once before the next r...
ComponentA component is the smallest reusable unit of a React application: a function that receives...
Component TreeA React application is a tree of nested components: the root component sits at the top and...
CompositionReact recommends composition rather than inheritance for reusing components: the parent pa...
Conditional RenderingReact has no if tag: conditional rendering means writing ordinary JavaScript logic — if st...
Controlled ComponentsA controlled component is one whose value is driven by React state: the value is bound to ...
createContextcreateContext creates a Context object that lets data travel across levels of the tree wit...
CSS ModulesCSS Modules turn an ordinary CSS file into locally scoped styles: at build time every clas...
Custom HooksA custom hook is an ordinary function whose name starts with use, which may call other hoo...
D
Declarative UIDeclarative UI means you only describe what the interface should look like in a given stat...
Default PropsWhen a parent does not pass a prop, its value is undefined and the interface may end up bl...
Dependency ArrayThe dependency array tells an effect who it runs for: an empty array runs it once, and lis...
Dynamic FormsWhen the number of fields is not fixed, drive the rendering from an array kept in state: e...
E
Effect PitfallsThe pitfalls of useEffect cluster around the dependency array: a missing dependency reads ...
Entry FileThe entry file — usually src/main.jsx — is where a React application starts: it mounts the...
ErrorBoundaryAn ErrorBoundary is a component-level safety net: it catches errors in the child tree and ...
Event HandlingReact binds events with lower camel case onXxx props such as onClick and onChange, and the...
Event ParametersAn event handler receives the event object e and can read values such as target.value or k...
Event TypesEvent types come from @types/react: onClick is typed as MouseEvent<HTMLButtonElement> and ...
F
Filter & Sort ListsFiltering and sorting a list does not mutate the original array; instead you derive a new ...
Form InputsText inputs, checkboxes, selects and textareas all follow the same value-or-checked plus o...
Form ValidationThe essence of validation is deriving errors from state: a validation function computes an...
forwardRefFunction components do not receive a ref by default. forwardRef forwards the ref passed in...
Framer MotionFramer Motion (published today as the motion package) is the most popular animation librar...
Functional UpdatesPassing a function to setState, such as setCount(c => c + 1), means computing the next sta...
G
Generic ComponentsGeneric components let the type follow the data: a function List<T> renders an array of st...
J
JSXJSX is a syntax extension for JavaScript that lets you write interface markup directly ins...
JSX vs HTMLJSX looks like HTML, but a few rules differ: attributes use lower camel case, class become...
K
keyA key is the identity of an element inside a rendered list. React relies on it to recogniz...
L
List RenderingReact renders lists by mapping an array through map() into a set of JSX elements: prepare ...
M
Multi-Step FormsA multi-step form equals one step state, conditional rendering of the current step and a s...
N
NavLinkNavLink is a Link that knows about the active state: when the current address matches its ...
Nested ListsWhen the data has a multi-level structure such as categories containing entries, you rende...
Nested RoutesNested routes express a layout plus its child pages as parent and child Route elements: a ...
Next.js App RouterThe App Router is the file-convention router introduced in Next.js 13+: every folder under...
Next.js Data FetchingIn a Next.js server component you can await fetch directly, and next.revalidate controls t...
Next.js DeployVercel is the first choice for deploying Next.js — zero configuration, with support for IS...
O
Object & Array StateState must be replaced with a new object or a new array before React notices an update: us...
P
preventDefaulte.preventDefault() stops the browser's default action for an event, most famously the full...
PropsProps are the data a parent component hands down to a child, and they behave like function...
ProtectedRouteA route guard checks permissions before the page opens: wrap a route in ProtectedRoute, an...
Provider PatternThe Provider pattern packages the data and the methods that change it into a stateful Prov...
R
React DevToolsReact DevTools is the official browser extension that lets you inspect the component tree ...
React.lazyReact.lazy(() => import('./Page')) turns a component into a chunk that is only downloaded ...
React.memoWrapping a component in React.memo lets it skip a re-render when its props stay equal in a...
Reducer PatternsA few idiomatic patterns keep reducers tidy: lazy initialization through the third argumen...
Redux ToolkitRedux Toolkit (RTK) is the officially recommended way to write Redux: createSlice generate...
Render PropsRender props means passing the JSX you want rendered to a component as a function prop: th...
Rendering ModelReact updates in two steps: it first runs your component function to produce new JSX (rend...
Rules of HooksHooks obey two iron rules: call them only at the top level of a function component or a cu...
S
styled-componentsstyled-components is the flagship CSS-in-JS library: you write CSS inside JavaScript with ...
T
Tailwind in ReactTailwind CSS is an atomic CSS framework: it splits styles into single-purpose utility clas...
Three-State FetchingEvery data request has three states: loading while it is in flight, success once the data ...
Typed PropsIn TypeScript you use interface or type to build a contract for props: wrong names, missin...
U
UI LibrariesReact component libraries come in two flavours: full libraries such as Ant Design, MUI and...
useCallbackuseCallback caches a function reference: while the dependencies stay the same it returns t...
useContextuseContext takes a Context object created by createContext and returns the value of the ne...
useDebounceuseDebounce takes a value that changes rapidly, such as the text of a search box, and retu...
useEffectuseEffect is the declarative home for side effects — data fetching, subscriptions, timers,...
useFetch PatternExtract the three-state request logic into a useFetch(url) custom Hook: a component calls ...
useLocalStorageuseLocalStorage keeps the reads and writes of useState in sync with localStorage: it reads...
useMemouseMemo caches the result of a computation: while the dependencies stay the same it return...
useMutationuseMutation manages the async state of write operations (POST, PUT, DELETE): mutate trigge...
useNavigateuseNavigate returns a navigate function: go to the home page after signing in, return to t...
useParamsuseParams returns an object with the dynamic segments of the currently matched route: when...
useQueryuseQuery from TanStack Query manages the whole request lifecycle plus the cache: it dedupl...
useReduceruseReducer concentrates the question "how does the state change?" into one pure reducer fu...
useRefuseRef returns a container with a current property: it keeps any value alive across render...
useRef as ContainerA ref is not only for the DOM: it is a sticky-note box that survives renders and suits dat...
useStateuseState adds a state variable to a function component: it returns the current value and a...
V
Virtual DOMThe virtual DOM is a lightweight tree of plain JavaScript objects that React keeps in memo...
Vite SetupVite is today's mainstream scaffolder for React projects: one command generates a developm...
Vitest + RTLVitest is a very fast test runner that shares its configuration with Vite, and React Testi...
W
When Not to Memomemo, useMemo and useCallback are not free: comparing and caching cost something and the c...
Z
ZustandZustand is a minimal global state library: create defines a store, components call it like...
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏