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.

You can also use our online tool to write code and see the effect if you have not real development environment.
Categories: React

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X
0
Would love your thoughts, please comment.x
()
x