Sanity Studio v5: Embracing React 19

Written by Knut Melvær, Bjørge Næss

We're moving the sanity package from v4 to v5. The only breaking change to the Studio? We now require React 19.2 instead of supporting React 18.

That's it. Your schemas, plugins, and customizations work exactly as before.

If you're already on React 19.2, you're good to go. If not, follow the upgrade steps below.

Why we're doing this

React 19 shipped December 2024, bringing significant performance improvements and powerful new features. Sanity Studio has officially supported React 19 since day one. But maintaining backward compatibility with React 18 has held us back. It has now been out for one year, and it’s time to move with the rest of the ecosystem. For comparison, Next.js 15 has required React 19 since July 2025 through their version 15 and 16.

Here's what the React 18 compatibility cost us:

We couldn't use React 19's best features. The use() hook enables more efficient data fetching patterns. The <Activity> component (introduced in React 19.2) allows managing component visibility in performant, user-friendly ways. We've been watching these capabilities from the sidelines.

Every feature took longer to ship. Both our core team and plugin authors spent extra cycles ensuring React 18 compatibility. Time that could have gone into making Studio better.

Performance gains left on the table. React 19 includes rendering optimizations that benefit everyone. Staying on React 18 meant our users missed out.

We considered bending the rules and supporting both versions longer. But the ecosystem has moved on, and so should we.

We've been preparing for this

We have been part of the React Working Group, and we've shipped React Compiler-optimized code on npm for almost a year. Our internal benchmarks show 20-30% improvements in editing frame rates. We've even shipped products using React 19's experimental <Activity> component in production.

For the technical deep-dive, watch Cody Olsen's React Conf talk on how we adopted the React Compiler across our codebase.

Why 19.2 specifically?

You might wonder why we're requiring 19.2 instead of 19.0.

Upgrading from React 19.0 to 19.2 requires zero code changes. If you're already on any React 19 version, bumping to 19.2 is a simple dependency update. The <Activity> component we mentioned ships in 19.2, and we want to use it.

A note on the recent React Security Advisory

You may have seen CVE-2025-55182, a critical vulnerability in React Server Components.

Sanity Studio is not affected directly. Studio doesn't use React Server Components, and studios deployed with Sanity weren't vulnerable. We've reviewed all our internal apps and packages.

If your broader application uses React Server Components alongside Studio (like a Next.js App Router app), check that you're on the patched React versions (19.0.1, 19.1.2, or 19.2.1). Major hosting platforms including Vercel, Netlify, Cloudflare, and Deno also deployed network-level fixes before the vulnerability was publicly announced.

Since we're requiring React 19.2 for Sanity v5, use 19.2.3 or later to get both the features we need and the security fix.

What this means for you

If you're a Studio user

Nothing changes for you. The developers maintaining your Studio will handle the update. Once they do, you'll benefit from improved performance automatically.

If you're a developer maintaining Studios

Already on React 19.2? Upgrade to Sanity v5 when it ships. You're done.

Still on React 18? You'll need to upgrade React first.

Before you upgrade, make sure you've addressed any deprecation warnings. Run sanity dev with your current React 18 setup and check the console. React 18.3 added warnings for patterns that would break in 19. It’s fairly unlikely, but if you see warnings, fix them first.

Enable React Strict Mode for testing React 19 compatibility: Make sure reactStrictMode is enabled in your sanity.cli.ts (⚠️ not sanity.config.ts) to catch potential compatibility issues before upgrading. This setting only affects development mode and helps identify problems with concurrent features like Suspense:

You can also enable it via environment variable with SANITY_STUDIO_REACT_STRICT_MODE="true". This setting only applies during development with sanity dev and is ignored in production builds.

Then update Sanity and React:

Internal server error