gpt4 book ai didi

reactjs - 通用类型 'Component' 需要 2 个类型参数

转载 作者:搜寻专家 更新时间:2023-10-30 21:39:37 25 4
gpt4 key购买 nike

我正在尝试使用 tsreact-router v4 来制作演示,但我会得到错误。

Failed to compile.

Error in D:\data\code\taven\react-components-usage-ts\node_modules\@types\react-router\lib\withRouter.d.ts

(3,99): error TS2314: Generic type 'PureComponent<P, S>' requires 2 type argument(s).

最佳答案

我也看到了这个错误。这个错误是在2周前的最新版本4.0.12版本中出现的。使用以前的版本。在其中一切正常。

npm install --save @types/react-router@4.0.11

同样的事情发生在 react-route-dom 上。使用:

npm install --save @types/react-router-dom@4.0.4

关于reactjs - 通用类型 'Component<P, S>' 需要 2 个类型参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44897759/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com