use-dark-mode
use-dark-mode copied to clipboard
Added react@^17.0.0 as a peer dependency
This PR adds react@^17.0.0 as a peer dependency in order to avoid warnings on projects that use latest versions of React.
Please merge this @donavon as it produces errors
Hi, while react v18 release is already on horizon in the coming year, curious when this PR can be merged to at least support react v17.x.x? When I try to npm install (npm version: 8.1.2 from LTS version of Node), the following error will be produced.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving:
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from [email protected]
npm ERR! node_modules/use-dark-mode
npm ERR! use-dark-mode@"2.3.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Thanks!
ping @donavon
I would recommend using this instead as it will work with any future react versions:
"peerDependencies": {
"react": ">=16"
},
Until this gets merged, if anyone wants a workaround, you can use @fisch0920/use-dark-mode
from my fork here https://github.com/transitive-bullshit/use-dark-mode
It will work with React 17 and 18.
Any updates on this?