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

99
Views
¿Hay alguna forma de reproducir un sonido cuando carga la pantalla usando reactJs?

Estoy haciendo un sitio web usando reaccionar por primera vez. Me gustaría que cuando cargues el sitio por primera vez, mi sonido mp3 se reproduzca una vez y simplemente se detenga. Aquí está mi código de reacción hasta ahora

 import React, {Component} from 'react'; import {render} from 'react-dom'; import Sound from 'react-sound' import './styles.scss'; import sun from "/src/Images/cuteMovingSun.gif" import hereComesTheSun from '/src/Images/HereComesTheSunEdit.mp3' import useSound from 'use-sound'; const Title = () => { return <div>Good Morning, Sunshine!</div>; }; const [play] = useSound('hereComesTheSun'); render(<Title />, document.getElementById('root')); render( <img className = "sun" src={ sun }/>, document.getElementById('mySun'));

Todavía soy nuevo para reaccionar, así que todavía no tengo claras muchas cosas.

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!