Built-in APIs
Utility functions exported from the react package.
Official docs
Full reference: react.dev/reference/react/apis
Common APIs
| API | Purpose |
|---|---|
memo | Skip re-render if props unchanged |
lazy | Code-split component loading |
cache | Cache function results across renders |
startTransition | Mark updates as transitions |
use | Read resources in render (promises, context) |
Example: lazy + Suspense
import { lazy, Suspense } from 'react';
const Chart = lazy(() => import('./Chart'));
function Dashboard() {
return (
<Suspense fallback="Loading chart...">
<Chart />
</Suspense>
);
}