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:
parent
c3e2999fa6
commit
5e9b5e5d3c
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue