React 18 to React 19 Complete Migration Guide

React 19 removes forwardRef in favor of ref as a standard prop, replaces useFormState with useActionState, and introduces native Actions.

⚡ Automated 1-Line Codemod

npx codemod@latest react/19/migration-recipe .

🚨 Breaking Changes List

🔧 Verified Migration Diff

// React 18 -> 19 forwardRef Migration
- const MyInput = forwardRef((props, ref) => {
-   return <input ref={ref} {...props} />;
- });
+ function MyInput({ ref, ...props }: { ref?: React.Ref<HTMLInputElement> }) {
+   return <input ref={ref} {...props} />;
+ }