【发布时间】:2018-05-11 23:01:24
【问题描述】:
是否有任何文档说明基础包的版本如何与 @types 中的版本相关,以便在 Typescript 中使用?
我看到他们不是 1:1 和 f.eg.对于 react 15.4.2 我应该使用什么 @types/react?
【问题讨论】:
标签: typescript typescript-typings type-definition
是否有任何文档说明基础包的版本如何与 @types 中的版本相关,以便在 Typescript 中使用?
我看到他们不是 1:1 和 f.eg.对于 react 15.4.2 我应该使用什么 @types/react?
【问题讨论】:
标签: typescript typescript-typings type-definition
There is open issue about that on DefinitelyTyped。到目前为止,no one was able to do anything about it。
我看到他们不是 1:1 和 f.eg.对于 react 15.4.2 我应该使用什么 @types/react?
找到与库的特定版本兼容的类型版本的唯一方法是反复试验。
根据我的经验,如果您使用最新版本的图书馆,将 * 指定为在 package.json 中输入的版本大部分时间都有效。
【讨论】: