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

Move @types/react from deps to devDeps #3138

Closed
kyriiherman opened this issue Aug 28, 2021 · 7 comments
Closed

Move @types/react from deps to devDeps #3138

kyriiherman opened this issue Aug 28, 2021 · 7 comments
Labels

Comments

@kyriiherman
Copy link

Which package?

react-intl

Describe the bug

I use react v16 so I don't need @types/react v17 in my node_modules. And since react-intl is compatible with react v16 and v17 I think it's not a problem to move it to devDeps.

@longlho
Copy link
Member

longlho commented Sep 5, 2021

is this causing a compilation issue?

@kyriiherman
Copy link
Author

Yes, I have types/react@16 the the root of node_modules and there is a bug in TS that in such cases I have to set the path to types explicitly in tsconfig if these types are not in the node_modules/@types folder

Screenshot 2021-09-09 at 17 06 13

@longlho
Copy link
Member

longlho commented Sep 9, 2021

do you have a codesandbox?

@kyriiherman
Copy link
Author

No, this problem can't be reproduced in code sandbox, but I found an original issue: microsoft/TypeScript#42873.
Do you need typings for React@17 in dependencies for any reason?

@longlho
Copy link
Member

longlho commented Sep 14, 2021

Yeah we rely on react types for a bunch of stuff

@kyriiherman
Copy link
Author

kyriiherman commented Sep 14, 2021

I mean why these types can't be moved to devDependencies? And according to package.json react-intl can be used with react@16 as well:

"react": "^16.3.0 || 17",

@longlho
Copy link
Member

longlho commented Sep 20, 2021

because if you use TS and you use react-intl, we reference react types

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

No branches or pull requests

2 participants