-
Notifications
You must be signed in to change notification settings - Fork 1.1k
@testing-library/react has transitive deps to @types/react: * #508
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
Comments
Hi @jackyef, Thanks for the issue. React Testing Library does not include |
@kentcdodds Hi, you're right, I was incorrect in saying it was one of It goes like this:
Would there be a problem if we make |
Including them as dependencies is an intentional choice (read more: #437). Is there a reason you're not using the latest version of the react types? I think you probably should... |
Ah, I see! That was interesting to read the perspective of everyone involved :) For my specific case, yes, it would be totally fine to just use the latest version of For what it's worth, some people might be using an older version of I understand shipping |
@jackyef That is a long standing issue with how types are published from DefinitelyTyped. TL;DR: Most package managers do support these now so we can revisit this over at DefinitelyTyped. In the meantime I suggest you get familiar with manually editing your lockfile. For |
We have fixed this issue on our end. My reason for continuing the discussion here is mostly just to satisfy my curiosity 😃 I'll be looking forward to hear the updates over at DefinitelyTyped then, thanks! |
react-testing-library
version: 9.3.0What you did:
We have a react library written in typescript that has exact devDependency to
@types/react: "16.9.9".
@testing-library/react` is also one of the library devDependencies.What happened:
When installing all devDependencies (including bundler and babel stuffs) so we can build our library, we ended up with 2 different
@types/react
, because @testing-library/react has deps to@types/react: *
, which resolves to a newer version of@types/react
.Because there are 2 different
@types/react
,tsc
will fail when trying to build our package.Suggested solution:
Set
@types/*
packages asdevDependencies
of@testing-library/react
The text was updated successfully, but these errors were encountered: