<button onClick={...}> reads as “a button” with what it does when clicked, and a list rendered with map reads as “for each todo in visible”.
library: { name: "react", versions: ">=18 <20" }. It reads JSX as UI in files that import React, react-dom or Next.js, or that belong to a package depending on one of them (see Dependency detection). Files written for other JSX libraries, such as Solid or Preact, are left alone. If you use Next.js, use the Next.js plugin instead, because it already includes this one.
Examples
State, conditions and lists
English
Effects, memos and refs
English
Actions, Suspense and lazy components
English
What it covers
- Components: function and arrow components, their props,
memo,forwardRef,lazy, render functions and class components that callsetState. - JSX as UI: HTML elements by what they are (a heading, a checkbox, a link to a page), conditional rendering with
&&, ternaries and early returns, lists rendered withmap, fragments, and event handlers with one or several steps. - Hooks:
useStateand functional updates,useEffectanduseLayoutEffectwith their dependencies and cleanups,useMemo,useCallback,useRef,useReduceranddispatch, context, custom hooks,useTransition,useDeferredValueanduseId. - React 19:
useActionState,useOptimistic,useFormStatus,use()and form actions. react-dom:createRoot,renderandcreatePortal.
Options
react({ elements }) takes extra readings for elements from other libraries, keyed by JSX tag. Each rule receives the engine, the tag and an attr(name) lookup, and returns the element’s description together with the attributes it has already described, or null to let the default reading apply. The Next.js plugin uses this to read Link, Image, Script and Form.
Translating
The English phrasebook is exported asen and typed as ReactPhrases.