dilidili / react-drawing-board

demo
https://react-drawing-board-demo.dilidili.now.sh
MIT License
68 stars 21 forks source link

React as a dependency causes incompatibility issues #19

Closed marcosalles closed 2 years ago

marcosalles commented 2 years ago

I tried using the package in a project that uses react specific versions (eg: "react": "16.5.0") and i got stuck with an invalid hook call error whenever and wherever I tried rendering the drawing board component.

I ended up in a specific troubleshooting page for invalid hook calls from react docs that points out the issue was happening due to duplicate react copies within the project, with a suggestion that dependencies of a project should not use react as a dependency but rather as a peer dependency. Looking at the peer dependency node documentation, which is not the case of this library. This library specifies react as a direct dependency, causing such issue.

I will fork and submit a fix myself asap, unless someone beats me to it.

dilidili commented 2 years ago

Hi @gabrielguilhoto, thanks for PR and I update the package with version 0.4.6.