Question: React dependency not a peer dependency?
See original GitHub issueHello!
My team is considering using this library. One thing that we were wondering about is why React and React-DOM is only listed in package.json
as a devDependency
and not as a peerDependency
also?
One thing that we’re trying to determine is what versions of React would work with this library. For example, we have a situation where we need to use an older version of React (15.x). Since React is not listed as a peer dependency in this library’s package.json
, we are not able to determine if something in this library would break with an older version of React.
Thanks for your help!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How do I resolve peer dependency error: The package react ...
How do I resolve peer dependency error: The package react@15.3.2 does not satisfy its siblings' peerDependencies requirements · I am having this same...
Read more >Why use peer dependencies?
First, let's break down what a peer dependency is. A peer dependency is a dependency of a library that isn't automatically installed.
Read more >Difference between dependencies, devDependencies and ...
As you install a package, npm will automatically install the dev dependencies. peerDependencies are not automatically installed. You need to ...
Read more >Understanding Peer Dependencies in JavaScript
In this case, you would declare React as a peer dependency for your components, because you want the host project to have the...
Read more >Addressing the shortcomings of peer dependencies - HackMD
It is an edge case, not a common case. Many of us who have run into the “2 copies of react” problem 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
@jasonkylefrank correct it should be at minimum
v16.x.x
. Thanks for raising this as I need to fix how deps are handled in all these packages.Hi @moog16! Just to clarify, you’re saying that the
peerDependencies
should be the same as what is listed in thedevDependencies
? That is:Regarding whether or not the compiled version would work in a React 15.x codebase, I do not have any insight. 😀