rn-perfect-sketch-canvas icon indicating copy to clipboard operation
rn-perfect-sketch-canvas copied to clipboard

'useRef' for Javascript

Open aidyun opened this issue 1 year ago • 3 comments

I noticed that your example is in TypeScript. When I try copying the sample code into my JavaScript code, I get an error, saying:

Error: Function components cannot have string refs. We recommend using useRef() instead.

When I remove the useRef, there are no errors, but then I can't reset the canvas.

aidyun avatar Oct 15 '22 18:10 aidyun