Upgrade studio packages
From time to time, versions of packages Sanity Studio depends on need to be upgraded. This can be done either by manually entering a new version of the dependency in your studio folder's package.json, or by running a command from your command line.
Upgrade React
Before you upgrade, check that your Sanity Studio version supports the newest React release, which is what react@latest installs. The supported React range for each Studio version is listed in "Known Sanity Studio version compatibilities." To upgrade React and React DOM to the latest version, run:
npm install "react@latest" "react-dom@latest"pnpm add "react@latest" "react-dom@latest"yarn add "react@latest" "react-dom@latest"bun add "react@latest" "react-dom@latest"Note: if you have customizations in your Sanity Studio and are upgrading between major versions of React (for example, going from version 18 to 19), you may need to adjust your React components as well. Consult the release announcements on the React blog for details on how to migrate to the latest version.
Known Sanity Studio version compatibilities
This is a non-exhaustive list of dependencies Sanity Studio is known to work with. Anything outside of these ranges might still work, but we recommend keeping up to date with current versions to get the latest stability and performance improvements.
v6.x
node@>=22.12react@^19.2.2react-dom@^19.2.2styled-components@^6.1.15@sanity/ui@^4.x
v5.x
node@>=20.19 <22 || >=22.12react@^19.2.2react-dom@^19.2.2styled-components@^6.1.15@sanity/ui@^3.x
v4.x
node@>=20.19 <22 || >=22.12react@^18.2.x - react@19.xreact-dom@^18.2.x - react-dom@19.xstyled-components@^6.x@sanity/ui@^3.x
v3.69.0 to v3.99.0
node@>=18react@^18.2.x - react@19.xreact-dom@^18.2.x - react-dom@19.xstyled-components@^6.x@sanity/ui@^2.x
Earlier than v3.69.0
node@>=18react@^18.2.xreact-dom@^18.2.xstyled-components@^6.xin v3.37.0 and later. v3.19.0 to v3.36.x accept^5.2 || ^6, and earlier versions accept only^5.2.@sanity/ui@^2.xin v3.25.0 and later. Earlier versions use@sanity/ui@^1.x, except v3.23.0 to v3.24.x, which use a2.0.0beta.
Was this page helpful?
Feedback submitted, thanks for helping us improve the docs. Have you tried these alternatives?