Closed
Description
React version: [email protected]
Steps To Reproduce
- Run
npm install [email protected] [email protected]
. - Run
npm install [email protected]
. Note the React peer dependency error.
Notably, this currently affects npm install react@16 next@10
(see vercel/next.js#18518). npm@7
will refuse to perform this installation entirely.
The current behavior
[email protected]
peer-depends on react@^16.8.0
whereas [email protected]
peer-depends on react@^17.0.0
, which is generally considered a breaking change in a minor version. This might have been an oversight in how #20062 interacted with #19373?
(It's considered a breaking change because a package.json like the below should always result in a valid install.)
{
"dependencies": {
"react": "^16.14.0",
"use-subscription": "^1.4.1"
}
}
The expected behavior
Here are two potential solutions:
- Cut a release of
[email protected]
that peer-depends on^16.8.0 || ^17.0.0
, strictly widening the peer dep range from that of 1.4.1. - Cut a major release of
use-subscription@2
that peer-depends on^17.0.0
, and cut a release of[email protected]
that reverts its peer dependency to^16.8.0
.