DEV Community

Karim-Mabrouk
Karim-Mabrouk

Posted on

Why doesn't ReactJS appear in my HTML website?!

Hello guys!

I've been trying to add a ReactJS component to my HTML website but it still doesn't work. I followed all the instructions written here https://reactjs.org/docs/add-react-to-a-website.html (including the 3 links+ embedding the file name at the end of the page+ and creating a div with an id+ running the 3 commands of Babel in the command line+ ReactDOM.render(< Component Name />, document.getElementById("#id");) and none of what is written in the page is working. What do I do?! And are there further instructions not written in the link I provided?!

P.S. The file is written in .jsx extension

Top comments (2)

Collapse
 
devdufutur profile image
Rudy Nappée

Try to remove the hash before the id of the élément 😉

Collapse
 
hasone profile image
HasOne

when you're dealing with getElementById(), so you don't need to add #, because you already told the interpreter that gave me Id element!

and you should use # dot( . ) when dealing querySelector();