Sébastien Rigaux

React’s browser() API: rendering components only in the browser

View resource

certificates.dev

React Canary introduces the browser() API to render a component exclusively in the browser, avoiding hydration mismatches and extra mounted-state logic. The article demonstrates how to use use(browser()) inside a client component, wrapped in Suspense, to defer rendering until browser APIs are available. Several concrete examples show how this approach enables access to localStorage, the DOM, or user-specific data, without the usual workarounds like useEffect or environment checks.

Illustration for the certificates.dev article on React browser() API