Replace ReactDOM.render with createRoot
Recipe ID
org.openrewrite.react.18.replace-reactdom-renderArtifact@openrewrite/recipes-reactMigrates from the legacy ReactDOM.render() API to the createRoot() API from react-dom/client introduced in React 18.
Single recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.react.18.replace-reactdom-renderIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-react