use-dark-mode icon indicating copy to clipboard operation
use-dark-mode copied to clipboard

Added react@^17.0.0 as a peer dependency

Open gragland opened this issue 4 years ago • 6 comments

This PR adds react@^17.0.0 as a peer dependency in order to avoid warnings on projects that use latest versions of React.

gragland avatar Feb 14 '21 20:02 gragland

Please merge this @donavon as it produces errors

lukasoppermann avatar Nov 01 '21 20:11 lukasoppermann

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!

joyfulelement avatar Dec 22 '21 01:12 joyfulelement

ping @donavon

SevenOutman avatar Feb 24 '22 04:02 SevenOutman

I would recommend using this instead as it will work with any future react versions:

  "peerDependencies": {
    "react": ">=16"
  },

transitive-bullshit avatar Mar 31 '22 03:03 transitive-bullshit

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.

transitive-bullshit avatar Mar 31 '22 03:03 transitive-bullshit

Any updates on this?

pranaynailwal avatar Jan 25 '23 07:01 pranaynailwal