Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand peerDependencies range for react #336

Open
mosofsky opened this issue Feb 5, 2022 · 1 comment
Open

Expand peerDependencies range for react #336

mosofsky opened this issue Feb 5, 2022 · 1 comment

Comments

@mosofsky
Copy link

mosofsky commented Feb 5, 2022

Is your feature request related to a problem? Please describe.

Currently react-digraph 7.x and 8.x contain an old version of react as peer dependencies in their package.json, for example:

  "peerDependencies": {
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "d3": "^5.16.0"
  },

source: https://github.com/uber/react-digraph/blob/v8.0.0-beta.8/package.json

Describe the solution you'd like

Test with react 17 and if everything works, expand the range like this:

  "peerDependencies": {
    "react": "^16.12.0 || ^17.0.0",
    "react-dom": "^16.12.0  || ^17.0.0",
    "d3": "^5.16.0"
  },

This OR syntax is discussed at https://stackoverflow.com/questions/47309598/make-your-npm-package-support-multiple-versions-of-peer-depedency and there's a nice tool at https://semver.npmjs.com/ for verifying that it works.

Describe alternatives you've considered

The alternative is for me just to ignore the yarn install warnings I get and pray they're not a problem:

warning " > [email protected]" has incorrect peer dependency "react@^16.12.0".
warning " > [email protected]" has incorrect peer dependency "react-dom@^16.12.0".
warning " > [email protected]" has unmet peer dependency "d3@^5.16.0".

Additional context

React 17 was released on October 20, 2020 and the release notes are here https://reactjs.org/blog/2020/10/20/react-v17.html and more breaking changes are described at https://reactjs.org/blog/2020/08/10/react-v17-rc.html#other-breaking-changes . If none of these matter, then it would be great to expand the peerDependencies.

@Jyrno42
Copy link

Jyrno42 commented May 25, 2022

Been using the library with react 17 for a while now and have not encountered any issues. In fact I am now testing with react 18 and will let you know if there are any problems or not.

E: Everything we are doing seems to work nicely with react 18 too. Only problem is the ReactDOM.render deprecation warning being logged to the console.

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

No branches or pull requests

2 participants