replace-use-form-state
Rename useFormState to useActionState in react-dom imports and usages.
Usage
bash
Development
bash
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
Rename useFormState to useActionState in react-dom imports and usages
npx codemod @react-new/replace-use-form-state
Rename useFormState to useActionState in react-dom imports and usages.
bash
bash
This is one example from the codemod's test cases. The codemod may handle many more cases.
Build your own codemod and share it with the community.
1 import { useFormState as UFS, createPortal } from "react-dom";
2
3 function StatefulForm({}) {
4 const [state, formAction] = UFS(increment, 0);
5
6 createPortal();
7 return <form></form>;
8 }
9