Registry
Mmohebifar avatar

react-19-3-unprefix-stable-apis

Rename unstable_/experimental_ React APIs that became stable in React 19.2 and 19.3 to their stable names

mohebifar18 executions

  • React
  • ViewTransition
  • Activity
  • useEffectEvent
Connect a repo
npx codemod react-19-3-unprefix-stable-apis

react-19-3-unprefix-stable-apis

Rename experimental React APIs that became stable in React 19.2 and 19.3 to their stable, unprefixed names.

BeforeAfterStable since
unstable_ViewTransitionViewTransition19.3
unstable_addTransitionTypeaddTransitionType19.3
unstable_ActivityActivity19.2
experimental_useEffectEventuseEffectEvent19.2

The codemod handles named imports (with or without aliases), React.unstable_ViewTransition member access through a default or namespace import, CommonJS require("react") destructuring, JSX tag names, re-exports, and every usage site of a renamed binding.

unstable_startGestureTransition is not touched because it has not been stabilized.

Usage

bash
npx codemod react-19-3-unprefix-stable-apis --target <path>

Example

tsx
// Before
import { unstable_ViewTransition as ViewTransition, unstable_addTransitionType } from "react";

startTransition(() => {
  unstable_addTransitionType("nav-forward");
  setPage(next);
});

// After
import { ViewTransition, addTransitionType } from "react";

startTransition(() => {
  addTransitionType("nav-forward");
  setPage(next);
});

If the stable name is already taken by another binding in the file, the import keeps the old local name (import { ViewTransition as unstable_ViewTransition } from "react") so nothing else in the file has to change.

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.