Skip to content

Added react@^17.0.0 as a peer dependency#68

Open
gragland wants to merge 1 commit into
donavon:developfrom
gragland:patch-1
Open

Added react@^17.0.0 as a peer dependency#68
gragland wants to merge 1 commit into
donavon:developfrom
gragland:patch-1

Conversation

@gragland

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown

Please merge this @donavon as it produces errors

@joyfulelement

Copy link
Copy Markdown

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: react@17.0.2
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 use-dark-mode@2.3.1
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!

@SevenOutman

Copy link
Copy Markdown

ping @donavon

@transitive-bullshit

Copy link
Copy Markdown

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

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

@transitive-bullshit

Copy link
Copy Markdown

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.

@pranaynailwal

Copy link
Copy Markdown

Any updates on this?

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.

6 participants