Skip to content
public-library›Rules›React›Render client-only preferences without a flash or hydration error

Render client-only preferences without a flash or hydration error

When server-rendered UI depends on a preference the server cannot read, apply it before the first paint with a small inline script, and mark the element the script changes with suppressHydrationWarning. When the server can read the preference, render it on the server instead.

In the full rule