Skip to content

Commit 863168d

Browse files
authored
Sync @next/third-parties with React peer versions (#71261)
1 parent b6fa6be commit 863168d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/third-parties/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
},
3434
"peerDependencies": {
3535
"next": "^13.0.0 || ^14.0.0 || ^15.0.0",
36-
"react": "^18.2.0 || 19.0.0-rc-70fb1363-20241010"
36+
"react": "^18.2.0 || 19.0.0-rc-cd22717c-20241013"
3737
}
3838
}

scripts/sync-react.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const filesReferencingReactPeerDependencyVersion = [
2121
'test/lib/next-modes/base.ts',
2222
]
2323
const appManifestsInstallingNextjsPeerDependencies = [
24+
'packages/third-parties/package.json',
2425
'examples/reproduction-template/package.json',
2526
'test/.stats-app/package.json',
2627
// TODO: These should use the usual test helpers that automatically install the right React version
@@ -344,8 +345,12 @@ Or, run this command with no arguments to use the most recently published versio
344345
const packageJsonPath = path.join(cwd, fileName)
345346
const packageJson = await fsp.readFile(packageJsonPath, 'utf-8')
346347
const manifest = JSON.parse(packageJson)
347-
manifest.dependencies['react'] = newVersionStr
348-
manifest.dependencies['react-dom'] = newVersionStr
348+
if (manifest.dependencies['react']) {
349+
manifest.dependencies['react'] = newVersionStr
350+
}
351+
if (manifest.dependencies['react-dom']) {
352+
manifest.dependencies['react-dom'] = newVersionStr
353+
}
349354
await fsp.writeFile(
350355
packageJsonPath,
351356
JSON.stringify(manifest, null, 2) +

0 commit comments

Comments
 (0)