score:3

Accepted answer

document.getElementsByTagName('body') returns an array of elements. So extracting the first element will fix your error:

ReactDOM.render(
  <Hello compiler="TypeScript" framework="React" />,
  document.getElementsByTagName("body")[0]
);

Or you could use the more classic document.getElementsById("root"):

ReactDOM.render(
  <Hello compiler="TypeScript" framework="React" />,
  document.getElementById("root")
);

This assumes that the HTML contains a div with an id of root:

  <body>
    <div id="root"></div>
  </body>

Related Query

More Query from same tag