index.js
import ReactDOM from 'react-dom'
import App from './App'
import './index.css'
ReactDOM.render(<App/>, document.querySelector("#root"))
>Solution :
In React 18, the Index.js file structure changed and should look like this:
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<App />
);
reportWebVitals();