Closed pneha2296 closed 2 years ago
Sorry, I can't reproduce this. All test pass, the demo, CodeSandbox, and other examples all work with getTrimmedCanvas
.
my code is:
This is just JSX and not even a full component. It is missing many pieces, such as how you create the ref, for instance. This is not useable as a reproduction.
Furthermore, much of the code you added here is not specific to react-signature-canvas
and even adds props like ...register
that aren't related to this component.
I also had to fix various indentation issues in this code sample as well...
Please provide an actual, minimal reproduction or demo displaying this behavior, such as:
TypeError: sigCanvas.current.getTrimmedCanvas is not a function
That being said, this doesn't even seem to be a react-signature-canvas
error, and rather, seems to be a React usage issue.
getTrimmedCanvas
is not a function because sigCanvas.current
does not exist / is null
. Per the React ref
docs, ref.current
is null
before mounting and after unmounting.
my code is:
I used
label
to save image and it will throw error