Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
React
migration
bycodemod.com
React/19/Replace Reactdom Render
Made for
React
Last update
May 20, 2024
Replace reactDOM render
Description
Replaces usages of ReactDom.render()
with createRoot(node).render()
.
Examples
Before
import ReactDom from "react-dom";import Component from "Component";ReactDom.render(<Component />, document.getElementById('app'));
After
import { createRoot } from "react-dom/client";import ReactDom from "react-dom";import Component from "Component";const root = createRoot(document.getElementById('app'));root.render(<Component />);
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community