chore: 降级react及相关依赖到18.x版本

将项目的react、react-dom版本从19.x降级到18.3.1,同步更新对应的类型定义包,修正依赖匹配问题
This commit is contained in:
2026-07-01 21:50:05 +08:00
parent a691db573c
commit e6d93d7614
2 changed files with 76 additions and 65 deletions

View File

@@ -12,14 +12,14 @@
"dependencies": { "dependencies": {
"@arco-design/web-react": "^2.66.15", "@arco-design/web-react": "^2.66.15",
"axios": "^1.18.1", "axios": "^1.18.1",
"react": "^19.2.7", "react": "^18.3.1",
"react-dom": "^19.2.7", "react-dom": "^18.3.1",
"react-router-dom": "^7.18.0" "react-router-dom": "^7.18.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^24.13.2", "@types/node": "^24.13.2",
"@types/react": "^19.2.17", "@types/react": "^18.3.18",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^6.0.2", "@vitejs/plugin-react": "^6.0.2",
"typescript": "~6.0.2", "typescript": "~6.0.2",
"vite": "^8.1.0" "vite": "^8.1.0"

133
pnpm-lock.yaml generated
View File

@@ -10,29 +10,29 @@ importers:
dependencies: dependencies:
'@arco-design/web-react': '@arco-design/web-react':
specifier: ^2.66.15 specifier: ^2.66.15
version: 2.66.15(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7) version: 2.66.15(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
axios: axios:
specifier: ^1.18.1 specifier: ^1.18.1
version: 1.18.1 version: 1.18.1
react: react:
specifier: ^19.2.7 specifier: ^18.3.1
version: 19.2.7 version: 18.3.1
react-dom: react-dom:
specifier: ^19.2.7 specifier: ^18.3.1
version: 19.2.7(react@19.2.7) version: 18.3.1(react@18.3.1)
react-router-dom: react-router-dom:
specifier: ^7.18.0 specifier: ^7.18.0
version: 7.18.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7) version: 7.18.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
devDependencies: devDependencies:
'@types/node': '@types/node':
specifier: ^24.13.2 specifier: ^24.13.2
version: 24.13.2 version: 24.13.2
'@types/react': '@types/react':
specifier: ^19.2.17 specifier: ^18.3.18
version: 19.2.17 version: 18.3.18
'@types/react-dom': '@types/react-dom':
specifier: ^19.2.3 specifier: ^18.3.5
version: 19.2.3(@types/react@19.2.17) version: 18.3.5(@types/react@18.3.18)
'@vitejs/plugin-react': '@vitejs/plugin-react':
specifier: ^6.0.2 specifier: ^6.0.2
version: 6.0.3(vite@8.1.0(@types/node@24.13.2)) version: 6.0.3(vite@8.1.0(@types/node@24.13.2))
@@ -180,13 +180,16 @@ packages:
'@types/node@24.13.2': '@types/node@24.13.2':
resolution: {integrity: sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA==} resolution: {integrity: sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA==}
'@types/react-dom@19.2.3': '@types/prop-types@15.7.15':
resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==}
peerDependencies:
'@types/react': ^19.2.0
'@types/react@19.2.17': '@types/react-dom@18.3.5':
resolution: {integrity: sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw==} resolution: {integrity: sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==}
peerDependencies:
'@types/react': ^18.0.0
'@types/react@18.3.18':
resolution: {integrity: sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==}
'@vitejs/plugin-react@6.0.3': '@vitejs/plugin-react@6.0.3':
resolution: {integrity: sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg==} resolution: {integrity: sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg==}
@@ -495,10 +498,10 @@ packages:
peerDependencies: peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc
react-dom@19.2.7: react-dom@18.3.1:
resolution: {integrity: sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==} resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==}
peerDependencies: peerDependencies:
react: ^19.2.7 react: ^18.3.1
react-focus-lock@2.13.7: react-focus-lock@2.13.7:
resolution: {integrity: sha512-20lpZHEQrXPb+pp1tzd4ULL6DyO5D2KnR0G69tTDdydrmNhU7pdFmbQUYVyHUgp+xN29IuFR0PVuhOmvaZL9Og==} resolution: {integrity: sha512-20lpZHEQrXPb+pp1tzd4ULL6DyO5D2KnR0G69tTDdydrmNhU7pdFmbQUYVyHUgp+xN29IuFR0PVuhOmvaZL9Og==}
@@ -538,8 +541,8 @@ packages:
react: '>=16.6.0' react: '>=16.6.0'
react-dom: '>=16.6.0' react-dom: '>=16.6.0'
react@19.2.7: react@18.3.1:
resolution: {integrity: sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==} resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
resize-observer-polyfill@1.5.1: resize-observer-polyfill@1.5.1:
@@ -550,8 +553,8 @@ packages:
engines: {node: ^20.19.0 || >=22.12.0} engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true hasBin: true
scheduler@0.27.0: scheduler@0.23.2:
resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==}
scroll-into-view-if-needed@2.2.31: scroll-into-view-if-needed@2.2.31:
resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==}
@@ -653,7 +656,7 @@ snapshots:
dependencies: dependencies:
color: 3.2.1 color: 3.2.1
'@arco-design/web-react@2.66.15(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7)': '@arco-design/web-react@2.66.15(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies: dependencies:
'@arco-design/color': 0.4.0 '@arco-design/color': 0.4.0
'@babel/runtime': 7.29.7 '@babel/runtime': 7.29.7
@@ -663,11 +666,11 @@ snapshots:
dayjs: 1.11.21 dayjs: 1.11.21
lodash: 4.18.1 lodash: 4.18.1
number-precision: 1.6.0 number-precision: 1.6.0
react: 19.2.7 react: 18.3.1
react-dom: 19.2.7(react@19.2.7) react-dom: 18.3.1(react@18.3.1)
react-focus-lock: 2.13.7(@types/react@19.2.17)(react@19.2.7) react-focus-lock: 2.13.7(@types/react@18.3.18)(react@18.3.1)
react-is: 18.3.1 react-is: 18.3.1
react-transition-group: 4.4.5(react-dom@19.2.7(react@19.2.7))(react@19.2.7) react-transition-group: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
resize-observer-polyfill: 1.5.1 resize-observer-polyfill: 1.5.1
scroll-into-view-if-needed: 2.2.31 scroll-into-view-if-needed: 2.2.31
shallowequal: 1.1.0 shallowequal: 1.1.0
@@ -761,12 +764,15 @@ snapshots:
dependencies: dependencies:
undici-types: 7.18.2 undici-types: 7.18.2
'@types/react-dom@19.2.3(@types/react@19.2.17)': '@types/prop-types@15.7.15': {}
dependencies:
'@types/react': 19.2.17
'@types/react@19.2.17': '@types/react-dom@18.3.5(@types/react@18.3.18)':
dependencies: dependencies:
'@types/react': 18.3.18
'@types/react@18.3.18':
dependencies:
'@types/prop-types': 15.7.15
csstype: 3.2.3 csstype: 3.2.3
'@vitejs/plugin-react@6.0.3(vite@8.1.0(@types/node@24.13.2))': '@vitejs/plugin-react@6.0.3(vite@8.1.0(@types/node@24.13.2))':
@@ -1020,56 +1026,59 @@ snapshots:
proxy-from-env@2.1.0: {} proxy-from-env@2.1.0: {}
react-clientside-effect@1.2.8(react@19.2.7): react-clientside-effect@1.2.8(react@18.3.1):
dependencies: dependencies:
'@babel/runtime': 7.29.7 '@babel/runtime': 7.29.7
react: 19.2.7 react: 18.3.1
react-dom@19.2.7(react@19.2.7): react-dom@18.3.1(react@18.3.1):
dependencies: dependencies:
react: 19.2.7 loose-envify: 1.4.0
scheduler: 0.27.0 react: 18.3.1
scheduler: 0.23.2
react-focus-lock@2.13.7(@types/react@19.2.17)(react@19.2.7): react-focus-lock@2.13.7(@types/react@18.3.18)(react@18.3.1):
dependencies: dependencies:
'@babel/runtime': 7.29.7 '@babel/runtime': 7.29.7
focus-lock: 1.3.6 focus-lock: 1.3.6
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.7 react: 18.3.1
react-clientside-effect: 1.2.8(react@19.2.7) react-clientside-effect: 1.2.8(react@18.3.1)
use-callback-ref: 1.3.3(@types/react@19.2.17)(react@19.2.7) use-callback-ref: 1.3.3(@types/react@18.3.18)(react@18.3.1)
use-sidecar: 1.1.3(@types/react@19.2.17)(react@19.2.7) use-sidecar: 1.1.3(@types/react@18.3.18)(react@18.3.1)
optionalDependencies: optionalDependencies:
'@types/react': 19.2.17 '@types/react': 18.3.18
react-is@16.13.1: {} react-is@16.13.1: {}
react-is@18.3.1: {} react-is@18.3.1: {}
react-router-dom@7.18.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7): react-router-dom@7.18.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies: dependencies:
react: 19.2.7 react: 18.3.1
react-dom: 19.2.7(react@19.2.7) react-dom: 18.3.1(react@18.3.1)
react-router: 7.18.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7) react-router: 7.18.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react-router@7.18.0(react-dom@19.2.7(react@19.2.7))(react@19.2.7): react-router@7.18.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies: dependencies:
cookie: 1.1.1 cookie: 1.1.1
react: 19.2.7 react: 18.3.1
set-cookie-parser: 2.7.2 set-cookie-parser: 2.7.2
optionalDependencies: optionalDependencies:
react-dom: 19.2.7(react@19.2.7) react-dom: 18.3.1(react@18.3.1)
react-transition-group@4.4.5(react-dom@19.2.7(react@19.2.7))(react@19.2.7): react-transition-group@4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies: dependencies:
'@babel/runtime': 7.29.7 '@babel/runtime': 7.29.7
dom-helpers: 5.2.1 dom-helpers: 5.2.1
loose-envify: 1.4.0 loose-envify: 1.4.0
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.7 react: 18.3.1
react-dom: 19.2.7(react@19.2.7) react-dom: 18.3.1(react@18.3.1)
react@19.2.7: {} react@18.3.1:
dependencies:
loose-envify: 1.4.0
resize-observer-polyfill@1.5.1: {} resize-observer-polyfill@1.5.1: {}
@@ -1094,7 +1103,9 @@ snapshots:
'@rolldown/binding-win32-arm64-msvc': 1.1.3 '@rolldown/binding-win32-arm64-msvc': 1.1.3
'@rolldown/binding-win32-x64-msvc': 1.1.3 '@rolldown/binding-win32-x64-msvc': 1.1.3
scheduler@0.27.0: {} scheduler@0.23.2:
dependencies:
loose-envify: 1.4.0
scroll-into-view-if-needed@2.2.31: scroll-into-view-if-needed@2.2.31:
dependencies: dependencies:
@@ -1121,20 +1132,20 @@ snapshots:
undici-types@7.18.2: {} undici-types@7.18.2: {}
use-callback-ref@1.3.3(@types/react@19.2.17)(react@19.2.7): use-callback-ref@1.3.3(@types/react@18.3.18)(react@18.3.1):
dependencies: dependencies:
react: 19.2.7 react: 18.3.1
tslib: 2.8.1 tslib: 2.8.1
optionalDependencies: optionalDependencies:
'@types/react': 19.2.17 '@types/react': 18.3.18
use-sidecar@1.1.3(@types/react@19.2.17)(react@19.2.7): use-sidecar@1.1.3(@types/react@18.3.18)(react@18.3.1):
dependencies: dependencies:
detect-node-es: 1.1.0 detect-node-es: 1.1.0
react: 19.2.7 react: 18.3.1
tslib: 2.8.1 tslib: 2.8.1
optionalDependencies: optionalDependencies:
'@types/react': 19.2.17 '@types/react': 18.3.18
vite@8.1.0(@types/node@24.13.2): vite@8.1.0(@types/node@24.13.2):
dependencies: dependencies: