# React 18 to React 19 Complete Migration Guide
> Framework: React (v18.3 -> v19.0)
> Automated Codemod: `npx codemod@latest react/19/migration-recipe .`
> Canonical URL: https://agentnow.in/migrations/react-18-to-19-migration

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

## Key Breaking Changes
- `React.forwardRef` is deprecated and element.ref is now a standard prop on function components.
- `useFormState` is moved to `react` and renamed to `useActionState`.
- `ReactDOM.render` and `unmountComponentAtNode` have been completely removed.
- `<Context.Provider>` can now be written simply as `<Context>`.

## Automated Codemod Command
```bash
npx codemod@latest react/19/migration-recipe .
```

## Verified Code Migration Diff
```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} />;
+ }
```
