question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update package that it could be used in project which includes react 18

See original GitHub issue

npm update gives:

npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.3.0 || ^17" from react-share@4.4.0
npm ERR! node_modules/react-share
npm ERR!   react-share@"^4.4.0" 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.

Please, add react to peerDependecies as:

"react": ">=16.3.0"

I can not use this package in a project that includes react 18.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:21
  • Comments:8

github_iconTop GitHub Comments

5reactions
rossm6commented, May 15, 2022

Add to package.json

"overrides": {
    "react-share": {
      "react": "18.0.0",
      "react-dom": "18.0.0"
    }
  }
4reactions
NElnourcommented, May 17, 2022

@rossm6 it worked thanks! @zumek you need to specify that the overrides are for react-share, so it should be

...,
  "overrides": {
    "react-share": { <---- this is what you're missing!
      "react": "18.1.0",
      "react-dom": "18.1.0"
    }
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Upgrade to React 18
Updates to Client Rendering APIs​​ React 18 introduces a new root API which provides better ergonomics for managing roots. The new root API...
Read more >
React 18 Upgrade Guide and New Features - Refine Dev
React 18 was released! Are you looking to upgrade to React 18? Learn about the new features and changes in this comprehensive guide....
Read more >
Upgrading a create-react-app game to React 18
My mission is to upgrade it to React 18 and with hopes that all remains working. I'm not going to use any of...
Read more >
Upgrading to React 18 with TypeScript - LogRocket Blog
Now that React 18 has shipped, the type definitions for React 18 were updated in Sebastian's pull request. Many projects have been, and...
Read more >
Upgrading to React 18 - Daily Dev Tips
This will upgrade your react and react-dom versions to at least 18. ... Now that we upgraded React itself to version 18 let's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found