ts-react-toolbox icon indicating copy to clipboard operation
ts-react-toolbox copied to clipboard

@types/react should be listed in peerDependencies

Open theKashey opened this issue 6 years ago • 2 comments

https://github.com/gaearon/react-hot-loader/issues/1359

However, you don't specify the dependency for @types/react, which causes issues in projects where TypeScript compiler is running in "strict" mode and where dependencies are installed by a more strict package manager like pnpm (Rush).

It gives the following TypeScript error during application compilation:


TS7016: Could not find a declaration file for module 'react'.
'~/app/common/temp/node_modules/.registry.npmjs.org/react/16.10.2/node_modules/react/index.js' implicitly has an 'any' type.

theKashey avatar Oct 12 '19 04:10 theKashey

Good point. Is this only affecting peer deps? Just wondering what happens if you use or re expose a type from your lib, should that be listed as well?

zzarcon avatar Oct 18 '19 03:10 zzarcon

Probably no. You shall only "depend" on it, so the package manager would understand it.

theKashey avatar Oct 18 '19 04:10 theKashey