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

Fix useBgImage #141

Open mitjana opened 2 years ago

mitjana commented 2 years ago

The function called was not the right one

kandabi commented 2 years ago

I get this error trying to use this patch for getDataURL. The image seems to be empty, can you give an example on how you initialize & use getDataUrl?

Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or OffscreenCanvas or SVGImageElement or VideoFrame)'. at drawImageProp (drawImage.js:59:1) at CanvasDraw.getDataURL (index.js:124:1) at handleMouseOut (drawable-canvas.tsx:26:1)