Render HTML Elements to the DOM stuck

Render HTML Elements to the DOM stuck
0

#1

Tell us what’s happening:

What’s wrong with this code?
Also tried ReactDOM.render(<JSX/>, document.getElementById('challege-node'));

Your code so far


const JSX = (
  <div>
    <h1>Hello World</h1>
    <p>Lets render this to the DOM</p>
  </div>
);
// change code below this line
 ReactDOM.render(JSX, document.getElementById('challege-node'));

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/67.0.3396.99 Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/render-html-elements-to-the-dom


#2

You forgot to add # for your id.


#3

I didn’t think you had to do that in vanilla JS. Oh well. Guess I forgot.

PS Are you talking about https://www.w3schools.com/jsref/met_document_getelementbyid.asp ?
In which case you don’t need a #


#4

Actually you are right. haha I see the error now.

You have a typo!

It’s ‘challenge’


#5

Ah, Mr typo strikes again. Good spot :eyes: