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: React dependency not a peer dependency?

See original GitHub issue

Hello!

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:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
moog16commented, Jan 16, 2019

@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.

1reaction
jasonkylefrankcommented, Jan 16, 2019

Hi @moog16! Just to clarify, you’re saying that the peerDependencies should be the same as what is listed in the devDependencies? That is:

"react": "^16.4.2",
"react-dom": "^16.4.2"

Regarding whether or not the compiled version would work in a React 15.x codebase, I do not have any insight. 😀

Read more comments on GitHub >

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

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