useLayoutEffect SSR React Origin: On your device OSI layer 7 · Application Last updated 13 Oct 2026

Warning: useLayoutEffect does nothing on the server

A component using useLayoutEffect was server-rendered, where layout effects can’t run.

Exact message you may see useLayoutEffect does nothing on the server
Seen on: React

Meaning

Common in libraries during SSR (Next.js, Remix). Usually harmless; React 18.3+ removed this warning.

Common causes

  • Library component using useLayoutEffect rendered on the server
  • Your own SSR components measuring layout

⚡ Quick fix

  1. Use an isomorphic layout effect (useEffect on the server)
  2. Render the component client-only
  3. Upgrade React/library

Detailed fix by platform

React

  1. const useIsoLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;

How to diagnose

  1. Component — Which one?
  2. Need — Must it measure layout?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

[Vue warn]: Hydration node/text/children mismatch — Vue: [Vue warn]: Hydration text content mismatch / Hydration node mismatch: server rendered element contains more child nodes than client vdom (Vue)[Vue warn]: Hydration…async useEffect — Warning: useEffect must not return anything besides a function, which is used for clean-up. It looks like you wrote useEffect(async () => ...) (React)async useEffectHydration failed — Error: Hydration failed because the initial UI does not match what was rendered on the server (React)Hydration failedInvalid hook call — Error: Invalid hook call. Hooks can only be called inside of the body of a function component. (React)Invalid hook callInvalid hook call (duplicate React in Next.js) — Next.js: Error: Invalid hook call. Hooks can only be called inside of the body of a function component — Cannot read properties of null (reading 'useContext') (Next.js)Invalid hook call (du…Maximum update depth — Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. (React)Maximum update depthNuxt: Hydration completed but contained mismatches — Nuxt: [Vue warn]: Hydration completed but contains mismatches. (Vue)Nuxt: Hydration compl…Nuxt: window/document/localStorage is not defined (SSR) — Nuxt: ReferenceError: window is not defined / 500 Internal Server Error during SSR (Vue)Nuxt: window/document…useLayout…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.