Skip to content

Commit

Permalink
Update example of Server Actions HoC (#51299)
Browse files Browse the repository at this point in the history
Currently the Server Action function with `"use server"` must be an
async function as it's required by the compiler, even if it returns a
promise already.
  • Loading branch information
shuding committed Jun 14, 2023
1 parent c3e2999 commit 5e9b5e5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ export const action = withValidate((data) => {
```js filename="lib/form-validation.js"
export function withValidate(action) {
return (formData: FormData) => {
return async (formData: FormData) => {
'use server'

const isValidData = verifyData(formData)
Expand Down

0 comments on commit 5e9b5e5

Please sign in to comment.