← All recipes
Moderne licensed

Rename unstable_handleError to componentDidCatch

Recipe IDorg.openrewrite.react.16.error-boundariesArtifact@openrewrite/recipes-react

Renames the unstable error boundary method to the official componentDidCatch API introduced in React 16.

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.16.error-boundaries

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

mod config recipes npm install @openrewrite/recipes-react