pivotal-ui icon indicating copy to clipboard operation
pivotal-ui copied to clipboard

React 17

Open juanca opened this issue 3 years ago • 2 comments

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

I cannot upgrade to React 17 when using PivotalUI components in my codebase. Our test suite (which uses Enzyme) fails on components using PivotalUI components. e.g. OverlayTrigger

Note: there is a high likelihood that Enzyme just doesn't play well when there are varying React version in-play. But that's for another repo/issue.

Describe the solution you'd like

  1. Remove react from the dependencies list (it is already listed under peerDependencies)
  2. Add react to the devDependencies list (it is already listed under peerDependencies)
  3. Try out React 17 and (assuming it will pass) add ^17 to the react semver under peerDependencies

Describe alternatives you've considered

If it is broken, then that's all right. But I would highly encourage at least cleaning up dependencies <=> peerDependencies.

Additional context

juanca avatar Dec 10 '20 17:12 juanca

Thanks for the issue! I agree that this makes sense, but unfortunately I'm not sure when we'll have time to prioritize this.

In the meantime, if you're using Yarn, I wonder if something like this would work (in your package.json):

  "resolutions": {
    "pivotal-ui/react": "16.8",
    "pivotal-ui/react-dom": "16.8",
    "pivotal-ui/pui-react-animation/react": "16.8"
  },

(using whichever version of React you'd like)

reidmit avatar Dec 10 '20 17:12 reidmit

Everything seems to be working as expected with the resolutions. 👍 Thanks for the hotfix.

juanca avatar Dec 10 '20 18:12 juanca