Skip to content

Commit

Permalink
Merge branch 'canary' into refactor/remove-unused-logic
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed May 7, 2024
2 parents 7f04e95 + ce24b76 commit 3882bc6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export default async function createsUser(formData) {
}
```

Once the fields have been validated on the server, you can return a serializable object in your action and use the React [`useActionState`](https://react.dev/reference/react-dom/hooks/useActionState) hook to show a message to the user.
Once the fields have been validated on the server, you can return a serializable object in your action and use the React [`useActionState`](https://react.dev/reference/react/useActionState) hook to show a message to the user.

- By passing the action to `useActionState`, the action's function signature changes to receive a new `prevState` or `initialState` parameter as its first argument.
- `useActionState` is a React hook and therefore must be used in a Client Component.
Expand Down Expand Up @@ -1002,5 +1002,5 @@ For more information on Server Actions, check out the following React docs:
- [`"use server"`](https://react.dev/reference/react/use-server)
- [`<form>`](https://react.dev/reference/react-dom/components/form)
- [`useFormStatus`](https://react.dev/reference/react-dom/hooks/useFormStatus)
- [`useActionState`](https://react.dev/reference/react-dom/hooks/useActionState)
- [`useActionState`](https://react.dev/reference/react/useActionState)
- [`useOptimistic`](https://react.dev/reference/react/useOptimistic)
4 changes: 2 additions & 2 deletions packages/create-next-app/templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ export const installTemplate = async ({
* Default dependencies.
*/
dependencies: {
react: "^18",
"react-dom": "^18",
react: "19.0.0-beta-4508873393-20240430",
"react-dom": "19.0.0-beta-4508873393-20240430",
next: version,
},
devDependencies: {},
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/next-test/first-time-setup-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"next": "canary",
"react": "^18",
"react-dom": "^18"
"react": "19.0.0-beta-4508873393-20240430",
"react-dom": "19.0.0-beta-4508873393-20240430"
}
}
4 changes: 2 additions & 2 deletions test/e2e/next-test/first-time-setup-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
},
"dependencies": {
"next": "canary",
"react": "^18",
"react-dom": "^18"
"react": "19.0.0-beta-4508873393-20240430",
"react-dom": "19.0.0-beta-4508873393-20240430"
},
"devDependencies": {
"@types/react": "^18",
Expand Down

0 comments on commit 3882bc6

Please sign in to comment.