title: Play audio with React
body: <p>Whatever I do, I get an error message while trying to playing a sound:</p>
  <blockquote>
  <p>Uncaught (in promise) DOMException.</p>
  </blockquote>
  <p>After searching on Google I found that it should appear if I autoplayed the audio before any action on the page from the user but it's not the case for me. I even did this:</p>
  <pre><code>componentDidMount() {
    let audio = new Audio('sounds/beep.wav');
    audio.load();
    audio.muted = true;
    document.addEventListener('click', () =&gt; {
      audio.muted = false;
      audio.play();
    });
  }
  </code></pre>
  <p>But the message still appears and the sound doesn't play. What should I do?</p>