question: why "types/react" is included in deps?
See original GitHub issueI’m not an experienced Typescript, but I dont think it is a best practice to directly depend on @types/react
. Correct me if im wrong here and if it should be there please explain why.
Another aspect of this direct dependency is that there are 4 types of react consumers: raw js, compile2js lang, flowtype and typescript consumers. Even If it makes sense for typescript users that react-css directly depends on “types/react”, it introduces download, bandwidth and build time tax for everybody. I dont think it is fair
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:15 (15 by maintainers)
Top Results From Across the Web
why create-react-app puts types and typescript in ...
This question already has answers here: ... Basically they make all deps of regular types because (1) for React apps it doesn't matter...
Read more >[@types/react] useMemo's deps are should be optional #35275
I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript I have a question that is inappropriate for ...
Read more >@types/react - npm
Start using @types/react in your project by running `npm i @types/react`. There are 13583 other projects in the npm registry using @types/react.
Read more >types/react/index.d.ts - UNPKG
The CDN for @types/react. ... 807, /** Ensures that the props do not include ref at all */ ... 1082, function useEffect(effect: EffectCallback,...
Read more >it looks like you're trying to use typescript but do not have the ...
npm no longer installs peer dependencies so you need to install them manually, just do an npm install on the needed deps, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the best option is to have in optional dependencies and in dev deps.
True, and flow types are the complete source code 🤣