Use overrides
to fix reflux peerDependency resolution
#4704
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Make reflux use the project-level version of React to resolve its peerDependency.
With this change,
--legacy-peer-deps
will no longer be needed when installing with npm >= 8.6.0.Related issues
Part of #4703
Notes
Reflux specifies
"react": "^15.0.2"
as apeerDependency
. We use a newer major version of React. Starting with [email protected], this would start to breaknpm install
. More information: npm/cli: npm ci validates package-lock.json and could fail to resolveThe error you'd see when using npm >= 8.6.0 looked like:
Using
overrides
in package.json (added to npm in npm 8.3.0)tells npm that Reflux should use our project-level version of React to resolve its dependency on "react" — even though our project-level React (16) falls outside of the semver range that Reflux wants (^15.0.2).