ReactJS Day 2

Now lets change the code from src>App.js

if you don’t want to use App.js then you can directly change code of index.js with following:

import React from ‘react’;
import ReactDOM from ‘react-dom/client’;

const myFirstElement =

Hello React!

const root = ReactDOM.createRoot(document.getElementById(‘root’));
root.render(myFirstElement);

—— Now App.js file will not be called and our code is directly written here