Skip to content
Discussion options

You must be logged in to vote

I could not come up with some sensible example, because mine is very specific.
Yet it is possible to use it with with controller,and i had no issues about using it.
Here is something that can be used as code example :

  let signCanvas = useRef<ReactSignatureCanvas | null>(null);

// Function that will format canvas signature into PNG
    const formatIntoPng = () => {
      if (signCanvas.current) {
        const dataURL = signCanvas.current.toDataURL();
        return dataURL;
       }
    };

// Controler usage example that will save on end of drawing as PNG
<Controller
        name="some-name"
        control={control}
        render={({ value, onChange }) => (
          <SignatureCanvas

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by bluebill1049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants