← All recipes
Moderne licensed

Add initial value to useRef() calls

Recipe IDorg.openrewrite.react.19.use-ref-required-initialArtifact@openrewrite/recipes-react

Adds undefined as initial argument to useRef() calls with no arguments. Required by @types/react 19.

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.use-ref-required-initial

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

mod config recipes npm install @openrewrite/recipes-react