I'm making a website using react for the first time. I would like when you first load the site my mp3 sound plays once and just stops. Here is my react code so far
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'));
I'm still new to react so I'm still unclear on a lot of things.