import React from "react";
import ReactDOM from "react-dom/client";
function App() {
return <h1>Hello React</h1>
}
// Render items in the DOM using react 18
const root = ReactDOM.createRoot(document.getElementById
("root")); //id root is from the index.html
root.render(
<React.StrictMode>
<App />
</React.StrictMode>); //Wrapping the component with strict mode.
The root element refers to the top-level element that is the parent of all other components in your application. It is typically represented as a DOM node within the public/index.html file that serves as the entry point for your React app.
StrictMode is a tool for highlighting potential problems in an application. Like Fragment, StrictMode does not render any visible UI. It activates additional checks and warnings for its descendants.
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)