From 7bc3a241762135c0e2803febdb7df18c84278ce0 Mon Sep 17 00:00:00 2001 From: StephDietz Date: Wed, 25 Oct 2023 11:04:53 -0700 Subject: [PATCH] update types/react and types/react-dom packages and remove workaround --- dashboard/15-final/app/ui/invoices/create-form.tsx | 2 +- dashboard/15-final/app/ui/invoices/edit-form.tsx | 2 +- dashboard/15-final/package.json | 4 ++-- dashboard/15-final/tsconfig.json | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dashboard/15-final/app/ui/invoices/create-form.tsx b/dashboard/15-final/app/ui/invoices/create-form.tsx index c28f93b..2c234d3 100644 --- a/dashboard/15-final/app/ui/invoices/create-form.tsx +++ b/dashboard/15-final/app/ui/invoices/create-form.tsx @@ -11,7 +11,7 @@ import { import { Button } from '../button'; import { createInvoice } from '@/app/lib/actions'; // @ts-ignore React types do not yet include useFormState -import { useFormState } from 'react-dom'; +import { experimental_useFormState as useFormState } from 'react-dom'; export default function Form({ customers }: { customers: CustomerField[] }) { const initialState = { message: null, errors: [] }; diff --git a/dashboard/15-final/app/ui/invoices/edit-form.tsx b/dashboard/15-final/app/ui/invoices/edit-form.tsx index 41d14ae..cbf9a9c 100644 --- a/dashboard/15-final/app/ui/invoices/edit-form.tsx +++ b/dashboard/15-final/app/ui/invoices/edit-form.tsx @@ -11,7 +11,7 @@ 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 { useFormState } from 'react-dom'; +import { experimental_useFormState as useFormState } from 'react-dom'; export default function EditInvoiceForm({ invoice, diff --git a/dashboard/15-final/package.json b/dashboard/15-final/package.json index 35dcd0d..945022e 100644 --- a/dashboard/15-final/package.json +++ b/dashboard/15-final/package.json @@ -11,8 +11,8 @@ "@heroicons/react": "^2.0.18", "@tailwindcss/forms": "^0.5.6", "@types/node": "20.5.7", - "@types/react": "18.2.21", - "@types/react-dom": "18.2.7", + "@types/react": "18.2.32", + "@types/react-dom": "18.2.14", "@vercel/postgres": "^0.5.0", "autoprefixer": "10.4.15", "bcrypt": "^5.1.1", diff --git a/dashboard/15-final/tsconfig.json b/dashboard/15-final/tsconfig.json index 11dba1d..8c283d1 100644 --- a/dashboard/15-final/tsconfig.json +++ b/dashboard/15-final/tsconfig.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "types": ["react-dom/experimental"], "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true,