Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@types/react should be listed in peerDependencies #20

Open
theKashey opened this issue Oct 12, 2019 · 2 comments
Open

@types/react should be listed in peerDependencies #20

theKashey opened this issue Oct 12, 2019 · 2 comments

Comments

@theKashey
Copy link
Collaborator

gaearon/react-hot-loader#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.
@zzarcon
Copy link
Owner

zzarcon commented Oct 18, 2019

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?

@theKashey
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants