question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

question: why "types/react" is included in deps?

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
HenriBeckcommented, Jan 8, 2019

I think the best option is to have in optional dependencies and in dev deps.

1reaction
HenriBeckcommented, Jan 8, 2019

True, and flow types are the complete source code 🤣

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found