-
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.
fix(react-19-replace-use-form-state): changed import from react-dom t…
…o react (#1357) * fix(react-19-replace-use-form-state): changed import from react-dom to react * fix(react-19-replace-use-form-state): changed import from react-dom to react
- Loading branch information
1 parent
e7c78f8
commit 5041371
Showing
9 changed files
with
69 additions
and
30 deletions.
There are no files selected for viewing
13 changes: 7 additions & 6 deletions
13
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
{ | ||
"version": "1.0.6", | ||
"name": "react/19/replace-use-form-state", | ||
"private": false, | ||
"version": "1.0.7", | ||
"engine": "jscodeshift", | ||
"meta": { | ||
"git": "https://github.com/codemod-com/codemod/tree/main/packages/codemods/react/19/replace-use-form-state", | ||
"tags": ["react", "migration"] | ||
}, | ||
"private": false, | ||
"applicability": { | ||
"from": [["react", "<=", "18"]] | ||
}, | ||
"arguments": [], | ||
"meta": { | ||
"tags": ["react", "migration"], | ||
"git": "https://github.com/codemod-com/codemod/tree/main/packages/codemods/react/19/replace-use-form-state" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture1.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
4 changes: 2 additions & 2 deletions
4
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture2.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import ReactDOM from "react-dom"; | ||
import { useActionState } from "react"; | ||
|
||
function StatefulForm({}) { | ||
const [state, formAction] = ReactDOM.useActionState(increment, 0); | ||
const [state, formAction] = useActionState(increment, 0); | ||
return <form></form>; | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture3.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import * as ReactDOM from "react-dom"; | ||
import { useActionState } from "react"; | ||
|
||
function StatefulForm({}) { | ||
const [state, formAction] = ReactDOM.useActionState(increment, 0); | ||
const [state, formAction] = useActionState(increment, 0); | ||
return <form></form>; | ||
} |
3 changes: 2 additions & 1 deletion
3
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture5.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
3 changes: 2 additions & 1 deletion
3
packages/codemods/react/19/replace-use-form-state/__testfixtures__/fixture6.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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.