-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[React19/replace-use-form-state] Fix import updates (#1382)
- Loading branch information
Showing
8 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/codemods/react/19/replace-use-form-state/.codemodrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture7.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import { useFormState } from "react-dom"; | ||
|
||
export const UserRegistrationFormComponent = () => { | ||
const [formState, formAction] = useFormState(signupAction, initialState); | ||
|
||
return <form>{/* Form fields go here */}</form>; | ||
}; |
9 changes: 9 additions & 0 deletions
9
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture7.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use client"; | ||
|
||
import React, { useActionState } from "react"; | ||
|
||
export const UserRegistrationFormComponent = () => { | ||
const [formState, formAction] = useActionState(signupAction, initialState); | ||
|
||
return <form>{/* Form fields go here */}</form>; | ||
}; |
6 changes: 6 additions & 0 deletions
6
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture8.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import * as ReactDOM from "react-dom"; | ||
|
||
function StatefulForm({}) { | ||
const [state, formAction] = ReactDOM.useFormState(increment, 0); | ||
return <form></form>; | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture8.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
import { useActionState } from "react"; | ||
|
||
function StatefulForm({}) { | ||
const [state, formAction] = useActionState(increment, 0); | ||
return <form></form>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters