form action not working

I have a server component where im importing a server action which i want to call when a form is submitted using the form's action prop, however im getting:
Type '(taskData: FormData) => Promise<void>' is not assignable to type 'string'.ts(2322)
index.d.ts(2121, 9): The expected type comes from property 'action' which is declared here on type 'DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>'
Type '(taskData: FormData) => Promise<void>' is not assignable to type 'string'.ts(2322)
index.d.ts(2121, 9): The expected type comes from property 'action' which is declared here on type 'DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>'
<form action={createTaskForUser}>
<form action={createTaskForUser}>
1 Reply
whatplan
whatplan13mo ago
maybe try updating @types/react
Want results from more Discord servers?
Add your server