This commit is contained in:
Delba de Oliveira
2023-10-26 10:04:26 -07:00
parent d1c6a2fd62
commit 36a9c02bc9
3 changed files with 3 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ export type State = {
amount?: string[];
status?: string[];
};
message: string;
message?: string | undefined;
};
export async function createInvoice(prevState: State, formData: FormData) {

View File

@@ -8,7 +8,7 @@ import {
CurrencyDollarIcon,
UserCircleIcon,
} from '@heroicons/react/24/outline';
import { Button } from '../button';
import { Button } from '@/app/ui/button';
import { createInvoice } from '@/app/lib/actions';
import { useFormState } from 'react-dom';

View File

@@ -10,8 +10,7 @@ import {
import Link from 'next/link';
import { Button } from '../button';
import { updateInvoice } from '@/app/lib/actions';
// @ts-ignore React types do not yet include useFormState
import { experimental_useFormState as useFormState } from 'react-dom';
import { useFormState } from 'react-dom';
export default function EditInvoiceForm({
invoice,