← All recipes
Moderne licensed

Replace unmountComponentAtNode with createRoot().unmount()

Recipe IDorg.openrewrite.react.18.replace-unmount-component-at-nodeArtifact@openrewrite/recipes-react

Replaces ReactDOM.unmountComponentAtNode(container) with createRoot(container).unmount() from react-dom/client.

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-unmount-component-at-node

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-react