React throws "useDeferredValue is not available in this React build" when the hook is imported while the project still ships a React 17 (or earlier) runtime that never defined the hook.
useDeferredValue was added in the React 18 concurrent rendering release. Only React 18+ builds export the hook implementation, and the dispatcher uses a feature flag that stays false in older builds (React 17 or custom legacy bundles). When your code tries to call useDeferredValue on a React runtime that predates the hook, React throws this error before rendering any of the affected component tree. The hook simply does not exist in earlier releases, so you can no longer rely on the API until you upgrade the React build that ships with your app.
Run the following and confirm both packages resolve to React 18+:
npm list react react-domOr if you use Yarn:
yarn list react react-domThe commands must report version 18.0.0 or later. Any 17.x entry shows the build will keep using an older dispatcher, so the hook cannot exist.
Both packages are bundled together, so update them at the same time to avoid mismatched hooks:
npm install react@18 react-dom@18Or with Yarn:
yarn add react@18 react-dom@18If you want the latest patch release, use @latest. Avoid mixing 17.x and 18.x in production.
TypeScript and editor tooling depend on @types/react matching the React runtime. Upgrade the definitions as well:
npm install --save-dev @types/react@18 @types/react-dom@18Or with Yarn:
yarn add -D @types/react@18 @types/react-dom@18This makes sure your type checker knows useDeferredValue exists.
React 18 enables concurrent features only when you call createRoot from react-dom/client. Update your entry file:
Before (React 17):
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));After (React 18):
import { createRoot } from 'react-dom/client';
import App from './App';
const root = createRoot(document.getElementById('root'));
root.render(<App />);Without createRoot, the React build stays in legacy mode and concurrent hooks like useDeferredValue remain disabled.
Sometimes npm or Yarn keeps resolving the old React build. Remove node_modules and the lockfile, then reinstall:
rm -rf node_modules package-lock.json
npm installWith Yarn:
rm -rf node_modules yarn.lock
yarn installThat forces a clean install of React 18 instead of reusing cached packages.
Monorepos, pnpm, or Yarn workspaces can hoist an older React release from another package. Run:
npm ls reactor
yarn why reactLook for a single 18.x tree. If you see 17.x dependencies, use pnpm overrides, Yarn resolutions, or npm overrides to force every package to resolve React 18. If you use pnpm, also check that nodeLinker is set to node-modules when needed.
For framework users (Next.js, Remix, CRA, Vite), make sure that the framework version you run ships React 18 by default. Older Next.js versions (pre-13) still pin React 17, so upgrade the framework or override its transitive React dependency.
When the error surfaces alongside other concurrent hooks (useTransition, useId, useInsertionEffect), it is a strong signal that the build simply does not understand React 18 yet.
If you have to stay on React 17 temporarily, you can emulate deferred updates by debouncing state changes with useEffect, but you cannot import useDeferredValue without upgrading. Keep your lockfiles and CI scripts synced so a single React version is installed across all environments.
React Hook useCallback has a missing dependency: 'variable'. Either include it or remove the dependency array react-hooks/exhaustive-deps
React Hook useCallback has a missing dependency
Cannot use private fields in class components without TS support
Cannot use private fields in class components without TS support
Cannot destructure property 'xxx' of 'undefined'
Cannot destructure property of undefined when accessing props
useNavigate() may be used only in the context of a <Router> component.
useNavigate() may be used only in the context of a Router component
Cannot find module or its corresponding type declarations
How to fix "Cannot find module or type declarations" in Vite