Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update React to version 18 #82

Merged
merged 3 commits into from
Nov 10, 2022
Merged

Update React to version 18 #82

merged 3 commits into from
Nov 10, 2022

Conversation

MonkeyDo
Copy link
Contributor

@MonkeyDo MonkeyDo commented Nov 4, 2022

Related issue: #81

React 18 came out in March of this year.
Devs using react-bs-notifier and wishing to update to React 18 will see NPM errors about react-bs-notifier's peer dependency of react >=16.3 <18:

npm ERR! While resolving: react-bs-notifier@6.0.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
[…]
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=16.3 <18" from react-bs-notifier@6.0.0
npm ERR! node_modules/react-bs-notifier
npm ERR!   react-bs-notifier@"^6.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@17.0.2
npm ERR! node_modules/react
npm ERR!   peer react@">=16.3 <18" from react-bs-notifier@6.0.0
npm ERR!   node_modules/react-bs-notifier
npm ERR!     react-bs-notifier@"^6.0.0" from the root project

As far as I can tell no changes in the library code are required for this update to work (only changes are in the docs).
The two main options I see for this update are:

  1. declare a peer dependency on react >=18 and publish a new major version of react-bs-notifier
  2. modify the current peer dependency to react >=16.3 (removing <18) since no code change was required, and publish a new minor version of react-bs-notifier

I went for the first version, but I'm happy to modify the PR if option 2 is more appropriate.

Note on the updated package-lock.json file: the npm lockfile v2 format (used by npm v7) is backwards compatible to v1 lockfiles, so there shouldn't be any issues with the format change.

The npm lockfile v2 format (used by npm v7) is backwards compatible to v1 lockfiles.
v3+ supports React 17+
@chadly
Copy link
Owner

chadly commented Nov 9, 2022

sorry for the late reply. I definitely appreciate this!

I will merge and release this evening.

@MonkeyDo
Copy link
Contributor Author

MonkeyDo commented Nov 9, 2022

Much obliged !

@chadly chadly merged commit d04c97b into chadly:master Nov 10, 2022
@MonkeyDo MonkeyDo deleted the react-18 branch November 10, 2022 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants