Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
TypeError: sigCanvasRef.getTrimmedCanvas no es una función

Recibo el error anterior cuando uso getTrimmedCanvas. Leí que al usar un estilo de fondo se produce este error porque necesita un fondo blanco o algo así.

Hay más código, pero solo pegué las cosas relevantes.

¡Gracias por ayudar!

 import Popup from "reactjs-popup"; import SignaturePad from "react-signature-canvas"; export default function Homepage() { const sigCanvasRef = useRef({}); const clear = () => sigCanvasRef.current.clear(); const save = () => console.log(sigCanvasRef.getTrimmedCanvas().toDataURL("image/png")) return( <Popup modal trigger={<Button style={{ maxWidth: '40px', maxHeight: '40px', minWidth: '40px', minHeight: '40px' }} color="inherit"> <CreateIcon /> </Button>} closeOnDocumentClick={false} > {close => ( <> <div className={sigCanvas.signatureCanvas} > <SignaturePad ref={sigCanvasRef} canvasProps={ { style: {background: 'white', width:'100%', minHeight:'650%'} } } /> </div> <Button variant="contained" onClick={close}>back</Button> <Button variant="contained" onClick={clear}>clear</Button> <Button variant="contained" onClick={save}>save</Button> </> )} </Popup> )

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Accede a las referencias por la propiedad actual.

Prueba esto

 console.log(sigCanvasRef.current.getTrimmedCanvas().toDataURL("image/png"))
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!