Deprecation notice: ReactDOM.render is no longer supported in React 18

codewitharjun

Code With Arjun

Posted on April 3, 2022

Deprecation notice: ReactDOM.render is no longer supported in React 18

React 18 shipped yesterday (March 29th). ReactDOM.render has been deprecated in React18 and currently issues a warning and runs in a compatible mode.

click here to see details.

To resolve you can either revert to a previous version of React or update your index.js file to align with the React 18 syntax.

index.js

import { StrictMode } from "react";
import { createRoot } from "react-dom/client";

import App from "./App";

const rootElement = document.getElementById("root");
const root = createRoot(rootElement);

root.render(
  <StrictMode>
    <App />
  </StrictMode>
);
Enter fullscreen mode Exit fullscreen mode

Watch this video for detail:

💖 💪 🙅 🚩
codewitharjun
Code With Arjun

Posted on April 3, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related