react-sketch
react-sketch copied to clipboard
I wanted to Export the value of SketchField
Hi @tbolis,
Just wanted to know, Where can I get the value of the whiteboard after drawing.. something like exporting or is there any way to get the value of the SketchField whatever it stores.
I need a data on export like this file data.json.controlled.js have.
So, that I can load that data at any time..
i.e.,
<SketchField width='1024px' height='768px' tool={Tools.Pencil} lineColor='black' lineWidth={3} value={something} />
Can you please help me in this.
Thanks in advance.
Try this:
<SketchField ref={sketchRef} />
...
const drawnObjects = sketchRef.current.toJSON()