Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I wanted to Export the value of SketchField #158

Open
yadavendra15 opened this issue Oct 26, 2021 · 1 comment
Open

I wanted to Export the value of SketchField #158

yadavendra15 opened this issue Oct 26, 2021 · 1 comment

Comments

@yadavendra15
Copy link

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.

@huy-lv
Copy link

huy-lv commented Aug 11, 2022

Try this:

<SketchField ref={sketchRef} />
...
const drawnObjects = sketchRef.current.toJSON()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants