DefinitelyTyped / DefinitelyTyped/DefinitelyTyped

Bug: react was upgraded to react18, but types/react version is not limited in types/react-route, resulting in type compatibility error

Open
#59,809 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51.4k
Forks
30.4k
Avg merge
3d 21h
Merged PRs (30d)
108

Description

目前项目的版本 react的版本是17.x, 定义的types/react: "@types/react": "^17.0.20" "@types/react-dom": "^17.0.9",
"@types/react-router-dom": "^5.1.8",

但是@type/react-router-dom 定义的
162380831-fe5f088a-965d-445e-8909-3c661aaa31eb

导致项目构建下载依赖时 yarn install时 他会去下载最新的 @types/react@18.0.0,导致目前项目的react组件类型错误

期望@type/react-router-dom 与 @types/react-dom 一样

162381065-64b7043f-0c31-44e5-92d7-97eda61ce3f9

最终项目编译不成功

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the dependency declarations for @types/react-router-dom and compare them with @types/react-dom. Run yarn install and the project build to reproduce the React 17/18 type mismatch. Done means the React type dependency stays compatible with React 17 and the project compiles successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.