Skip to main content

Built-in APIs

Utility functions exported from the react package.

Official docs

Common APIs

APIPurpose
memoSkip re-render if props unchanged
lazyCode-split component loading
cacheCache function results across renders
startTransitionMark updates as transitions
useRead 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>
);
}