title: Unable to render react
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script&gt;
  const root = ReactDOM.createRoot(document.getElementById('root'));
   root.render(&lt;h1&gt;Hello, world!&lt;/h1&gt;);
  &lt;/script&gt;
  &lt;div id="root"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I am running the html snippet but getting a console error message , this code is from <a href="https://reactjs.org/docs/hello-world.html" rel="nofollow noreferrer">https://reactjs.org/docs/hello-world.html</a>   ,it runs fine on codepen but not my local browser, please help as i am new to react.js</p>