← All recipes
Moderne licensed

Replace ReactDOM.hydrate with hydrateRoot

Recipe IDorg.openrewrite.react.19.replace-reactdom-hydrateArtifact@openrewrite/recipes-react

Migrates from the legacy ReactDOM.hydrate() API to the hydrateRoot() API 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.19.replace-reactdom-hydrate

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

mod config recipes npm install @openrewrite/recipes-react