embiem / react-canvas-draw

React Component for drawing in canvas
https://embiem.github.io/react-canvas-draw/
MIT License
892 stars 315 forks source link

Allow React 17 as peer dependency #123

Closed daiyi closed 2 years ago

daiyi commented 3 years ago

React 17 has been around for a little bit. I'm using it in a new project and would like to use this library, but the peerDependencies are too restrictive and I get this error:

% npm install react-canvas-draw --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: project@1.0.0
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.x" from react-canvas-draw@1.1.1
npm ERR! node_modules/react-canvas-draw
npm ERR!   react-canvas-draw@"*" 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.

The release notes suggest that there should be exceeding few breaking changes between React 16 and 17, so I believe this is a safe change: https://reactjs.org/blog/2020/10/20/react-v17.html

embiem commented 2 years ago

Thanks! I couldn't find any issues when used with React 17, so I'll merge this.