react-canvas-draw icon indicating copy to clipboard operation
react-canvas-draw copied to clipboard

Property 'getDataURL' does not exist on type 'CanvasDraw'

Open leeprobert opened this issue 3 years ago • 1 comments

This is a typescript issue I think. I can see the method exists but it hasn't been added to the index.d.ts file that tells the compiler they are available. I tried to manually edit the file to include the signature but it still complains that: Property 'getDataURL' does not exist on type 'CanvasDraw' I think there are other methods missing from the type declaration. The Typescript support needs a bit of work.

leeprobert avatar May 12 '22 15:05 leeprobert

This is how you can bypass the compiler issues for just that one line of code:

// @ts-ignore: Unreachable code error
                let imageURL = canvasDrawRef.getDataURL('png', false, '0xffffff');

leeprobert avatar May 13 '22 14:05 leeprobert