What is wrong in this code? please guide me

const JSX = (
  <div>
    <h1>Hello World</h1>
    <p>Lets render this to the DOM</p>
  </div>
);
// Change code below this line
ReactDOM.render(
  <div id="challenge-node">
    <h1>Hello world</h1>
    <p>Second element</p>
    </div>,
  document.getElementById('challenge-node')
)

you are using the id challenge-node to render the app to,
but you should append the app to an already existing html not another react component

<html>
  <head></head>
<body>
 <div id="challenge-node">
 <h1>Hello world</h1>
    <p>Second element</p>
 </div>
<script>
ReactDOM.render(
  <div>
    <h1>Hello world</h1>
    <p>Second element</p>
    </div>,
  document.getElementById('challenge-node')
)
</script>
</body>

</html>
```

You have to render the JSX.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.