DEV Community

Cover image for Deprecation notice: ReactDOM.render is no longer supported in React 18
Code With Arjun
Code With Arjun

Posted on • Edited on

3 1

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:

Top comments (2)

Collapse
 
noralbazafra profile image
Noralba Zafra

Hello good afternoon, I am starting to work with React using a course with version 16, I would like to continue ulitizing this version, how can I create a project with this React build? (16)
Thanks

Collapse
 
codewitharjun profile image
Code With Arjun

Everything the process is similar with the previous version.

just use npx create-react-app app-name

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay