Skip to content

Expand peerDependencies range for react #336

Open

Description

@mosofsky

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 " > react-digraph@7.2.1" has incorrect peer dependency "react@^16.12.0".
warning " > react-digraph@7.2.1" has incorrect peer dependency "react-dom@^16.12.0".
warning " > react-digraph@7.2.1" 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.

Activity

  1. Jyrno42 commented on May 25, 2022

    @Jyrno42

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions