Issue importing createRoot from react-dom/client

The error message received indicates that you should be importing the createRoot method from react-dom/client instead of from react-dom.

To fix the issue, modify your import statement for createRoot to look like this :

import { createRoot } from 'react-dom/client';

So the modified code should be :

import React from 'react';
import { createRoot } from 'react-dom/client';
import Switch from './components/Switch';

const root = createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <Switch />
  </React.StrictMode>
);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)