()
| 29 | } |
| 30 | |
| 31 | const onChange = async () => { |
| 32 | const paths = await canvasRef.current.exportPaths(); |
| 33 | localStorage.setItem("paths", JSON.stringify(paths, null, 2)); |
| 34 | |
| 35 | if (!paths.length) return; |
| 36 | |
| 37 | setScribbleExists(true); |
| 38 | |
| 39 | const data = await canvasRef.current.exportImage("png"); |
| 40 | onScribble(data); |
| 41 | }; |
| 42 | |
| 43 | const undo = () => { |
| 44 | canvasRef.current.undo(); |