打字稿类型定义的版本控制(@ types /)

是否有任何文档说明基本软件包的版本如何与7月份在Typescript中使用的版本相关?

我看到他们不是1:1而且是f.eg.对于反应15.4.2我应该使用什么样的@类型/反应?

最佳答案
There is open issue about that on DefinitelyTyped.到目前为止,
no one was able to do anything about it.

I saw that they are not 1:1 and f.eg. for react 15.4.2 what @types/react should I use?

找到可以与库的特定版本兼容的打字版本的唯一方法是通过反复试验.

根据我的经验,如果您使用最新版本的lilbrary,请指定*作为package.json中typings的版本,大部分时间都可以使用.

点赞