-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
Description
Hello!
Thank you for this great library!
You are referencing react in public type declarations of your components, however, the @types/react dependency is missing from the manifest of the @material-ui/core package.
This leads to type-checking errors, because the types for react package couldn't be resolved from your declarations:
ERROR in /node_modules/.registry.npmjs.org/@material-ui/core/[email protected][email protected]/node_modules/@material-ui/core/Avatar/Avatar.d.ts
ERROR in /node_modules/.registry.npmjs.org/@material-ui/core/[email protected][email protected]/node_modules/@material-ui/core/Avatar/Avatar.d.ts(1,24):
TS7016: Could not find a declaration file for module 'react'. '/node_modules/.registry.npmjs.org/react/16.9.0/node_modules/react/index.js' implicitly has an 'any' type.
This happens in projects, which use more strict dependency management tools, like rush / pnpm, because they block access to implicit dependencies (like in your case).
In order to fix this, I would suggest to add @types/react and @types/react-dom packages to the peerDependencies section of the @material-ui/core package manifest.
Thanks!
oliviertassinari and r34son