useTransition typescript error

I have a server action that looks like this:

export async function deleteTask(id: string) {
  await prisma.task.delete({
    where: {
      id,
    },
  });

  revalidatePath("/projects/tasks");
}


I am importing this in a client component and calling it using the useTransition hook like this:

<DropdownMenuItem onClick={() => startTransition(() => deleteTask(task.id))}>Edit</DropdownMenuItem>


However im getting this ts error: Type 'Promise<void>' is not assignable to type 'VoidOrUndefinedOnly'
Was this page helpful?