embiem / react-canvas-draw

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

Fixed infinite loop when using loadSaveData triggering onChange #124

Open parbhatia opened 3 years ago

parbhatia commented 3 years ago

A bit rushed, this is what I changed to stop infinite rendering when using socket.io and multiple listeners. The basic problem being the inability to stop triggering onChange when loading saved data.

If loadSaveData is provided with a third boolean parameter triggerChange: false, we skip triggering the provided onChange function.

If no triggerChange is provided, it's business as usual.

embiem commented 3 years ago

Seems to be related to #93. Thanks for creating the PR!

MustaRohman commented 2 years ago

Hi @embiem @parbhatia! Thanks for this awesome package and this PR - may I ask, what is the status of this branch? Is there any way I can try to help progress this PR? :)