markusenglund / react-switch

A draggable toggle-switch component for React. Check out the demo at:
https://react-switch.netlify.com/
MIT License
1.33k stars 100 forks source link

Update `peerDependencies` to include React 18 #107

Closed CrescentKohana closed 2 years ago

CrescentKohana commented 2 years ago

React 18 is now available: https://reactjs.org/blog/2022/03/29/react-v18.html

Trying to use React 18 together with react-switch v6.0.0 (latest version as the time of writing) leads to a dependency conflict:

 ERROR ➜  npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mangatsu-web@0.3.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.3.0 || ^16.0.0 || ^17.0.0" from react-switch@6.0.0
npm ERR! node_modules/react-switch
npm ERR!   react-switch@"^6.0.0" from the root project

The culprit seems to be the peerDependencies defined here:

  "peerDependencies": {
    "react": "^15.3.0 || ^16.0.0 || ^17.0.0",
    "react-dom": "^15.3.0 || ^16.0.0 || ^17.0.0"
  },

Would it be possible to publish a new version which allows react-switch to be used with React 18 too?

coditori commented 2 years ago

Hi is there any update?

markusenglund commented 2 years ago

Will try to get an update shipped this weekend.

dnsnx commented 2 years ago

Any updates to this issue? Would appriciate this very much. Thank you in advance!

markusenglund commented 2 years ago

Fixed in 6.1.0, sorry for the delay.