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

148
Views
Cómo usar un script JQuery dentro de una aplicación React JSX

Me gustaría usar este complemento JQuery dentro de mi aplicación React: https://github.com/websanova/wScratchPad

Intenté escribir un elemento src en jsx y esto no está permitido. Luego importé $ de jquery pero dice que la función wScratchPad no está definida, lo que tiene mucho sentido, ¿cómo defino esta función/desde dónde debo importarla?

 <script type="text/javascript" src="./wScratchPad.min.js"></script> <script type="text/javascript"> $('#demo1').wScratchPad({ size:30, bg: './images/winner.png', fg: './images/fg.png', 'cursor': 'url("./cursors/coin.png") 5 5, default', scratchMove: function (e, percent) { $('#demo1-percent').html(percent); } }); </script>

Así es como se ve en html, y funciona perfectamente bien. ¿Cómo hago para que reaccione?

 {$('#demo1').wScratchPad({ size:30, bg: './images/winner.png', fg: './images/lottery.png', 'cursor': 'url("./cursors/sol.png") 5 5, default', scratchMove: function (e, percent) { $('#demo1-percent').html(percent); } })}

Quiero obtener algo como esto dentro de reaccionar.

¿Quizás alguien sabe de un componente de scratch-pad esque nativo para reaccionar?

Gracias

about 4 years ago · Juan Pablo Isaza
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!