← All recipes
Moderne licensed

Replace useFormState with useActionState

Recipe IDorg.openrewrite.react.19.replace-use-form-stateArtifact@openrewrite/recipes-react

In React 19, useFormState from react-dom has been renamed to useActionState and moved to react.

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-use-form-state

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

mod config recipes npm install @openrewrite/recipes-react