fix: Peer dependencies for NPM 7+ #1
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.
The way peer dependencies are handled has changed in NPM 7 and higher. Now NPM will attempt to install peer dependencies and fail if they cannot be installed, rather than simply suggesting they be installed.
The existing peer dependency in package.json is actually equivalent to: 'any version of React within the 16.2.X series and no higher' which is obviously not the intention as this is a package for React 18. At the time this was setup this wouldn't have caused a problem since NPM didn't insist upon installing peer dependencies but now anyone with an up to date version of NPM cannot install this package and will receive an error like so:
Although --force or --legacy-peer-deps will temporarily fix the issue it's not an ideal solution.
This commit is the minimal change in order to correct this: changing the peer dependency entry to mean 'any version higher than 16.2.0' which was probably the original intention.