- Replaces usages of ReactDom.render() with createRoot(node).render().
- Replaces usages of ReactDom.hydrate() with hydrateRoot()
- Replaces usages of ReactDom.unmountComponentAtNode() with root.unmount()
Example
Before
ts
After
ts
Before
ts
After
ts
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
The easiest way to run this codemod without installing anything globally:
ts
ts
ts
ts
Build your own codemod and share it with the community.