<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Utkrista KC</title>
    <description>The latest articles on Forem by Utkrista KC (@utkristakc).</description>
    <link>https://forem.com/utkristakc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F950672%2F01b3f5ff-4fbf-4fbb-9dbe-3d45697ec8f3.png</url>
      <title>Forem: Utkrista KC</title>
      <link>https://forem.com/utkristakc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/utkristakc"/>
    <language>en</language>
    <item>
      <title>Solved Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead.</title>
      <dc:creator>Utkrista KC</dc:creator>
      <pubDate>Sat, 17 Dec 2022 06:11:36 +0000</pubDate>
      <link>https://forem.com/utkristakc/solved-warning-reactdomrender-is-no-longer-supported-in-react-18-use-createroot-instead-5c1b</link>
      <guid>https://forem.com/utkristakc/solved-warning-reactdomrender-is-no-longer-supported-in-react-18-use-createroot-instead-5c1b</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L_ZRriVY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9h4maxn3a8hikximi8z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L_ZRriVY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9h4maxn3a8hikximi8z.png" alt="Image description" width="880" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We get this warning as React 18 introduces a new root API&lt;br&gt;
for managing roots.&lt;/p&gt;

&lt;p&gt;For instance, this is the code instance in your project which has ReactDOM.render specified.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import "./index.css";

ReactDOM.render(&amp;lt;App /&amp;gt;, document.getElementById("root"));

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove this warning, simply follow this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import "./index.css";

const container = document.getElementById("root");
const root = createRoot(container);
root.render(&amp;lt;App /&amp;gt;);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
