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

248
Views
Howl Js: ¿Cómo reproducir el mismo botón después de la pausa?

Estoy creando una placa de sonido con una matriz mapeada. Tengo un controlador onClick que cambia el color del botón que está activo/reproduciendo y Reproducir/Pausar.

Actualmente puedo pausar el botón 'activo' pero no puedo reiniciar la pista para ese botón. Puedo dejar de reproducir esa pista si presiono un botón diferente para reproducir esa pista de botones.

Solo busco ayuda sobre cómo reproducir el mismo botón después de pausarlo.

Gracias :)

 const handleClick = (beat: string, index: number ) => { if (activeIndex === isActive) { setIsActive(!isActive); activeSound.play(); } if (activeSound) { activeSound.stop(); } if (!activeSound && activeIndex === isActive) { const newSound = createSound(beat); newSound.play(); setActiveSound(newSound); } if (activeIndex !== index) { const newSound = createSound(beat); newSound.play(); setActiveSound(newSound); } setActiveIndex(index); } return ( <Container> <Title> Melody </Title> <Grid> { melodyData.map((beat, index: number) => { return <Button key={index} $isActive={activeIndex === index} onClick={() => handleClick(beat.src, index)}>{beat.title}</Button> }) } </Grid> </Container> ) };
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!