I am following the React course and tried the hello world app. Initially, when I added the console.log(element), it was shown in the console. Then I added the render() also. From then, I am not able to see the element on the browser and also the log statement on the console. I am not able to understand what was wrong with this below code. I followed the instructions as mentioned in the videos.
import React from 'react'; import ReactDOM from 'react-dom'; const element = <h1>Hello World!</h1>; console.log(element); ReactDOM.render(element, document.getElementById("root"));
Please help me with this. This JS code is not rendering element on the browser.