title: React using refs instead of #id selector
body: <p>I have come across a few different articles saying refs are the 'react way' of doing things in place of the #id selector. I'm not certain why. What is the explanation for using refs instead of #id?</p>
  <pre><code>import {useRef} from 'react';
  
  function Home() {
    const exampleRef = useRef(null)
  
    return (
      &lt;div ref={exampleRef}&gt; Hello world &lt;/div&gt;
    )
  }
  
  export default Home;
  </code></pre>
  <p>vs.</p>
  <pre><code>function Home() {
    return (
      &lt;div id='example'&gt; Hello world &lt;/div&gt;
    )
  }
  </code></pre>