Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda