Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
How to use a JQuery Script inside of a React App JSX

I would like to use this JQuery plugin inside of my React App: https://github.com/websanova/wScratchPad

I tried writing a src element in jsx and this is not allowed. I then imported $ from jquery but it says the wScratchPad function is not defined which makes perfect sense, how do I define this function/where should I import it from?

<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>

This is what it looks like in html, and it works perfectly fine. How do I get it into react?

{$('#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);
          }
        })}

I want to get something like this inside of react.

Maybe someone knows of a scratch-pad esque component native to react?

Thanks

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda