Update example of Server Actions HoC (#51299)

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.
This commit is contained in:
Shu Ding 2023-06-14 21:17:45 +02:00 committed by GitHub
parent c3e2999fa6
commit 5e9b5e5d3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)