We had learned that ReactDOM.render()
can render some thing to web page. Now let’s try to change the default content in the root node to render a new object.
Remove <App />
and add our new code to show “hello world” on the web page:
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<h1>hello world</h1>
</React.StrictMode>
);
See the result on your browser after run npm run start
.