Versioning for typescript type definitions (@types/)

757 Views Asked by At

Is there any documentation on how the versions of the base packages relate to the ones from @types to be used in Typescript?

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

1

There are 1 best solutions below

0
On

There is open issue about that on DefinitelyTyped. So far, 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?

The only way to find version of typings comatible withr specific version of a library is by trial and error.

From my experience, if you use the latest version of a lilbrary, specifying * as a version for typings in package.json works most of the time.