add react-dom/experimental to out types in tsconfig in order to work around the useFormState ts error

This commit is contained in:
StephDietz
2023-10-25 10:17:22 -07:00
parent 978ce53dd8
commit 7801daab05
2 changed files with 2 additions and 1 deletions

View File

@@ -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 { experimental_useFormState as useFormState } from 'react-dom';
import { useFormState } from 'react-dom';
export default function Form({ customers }: { customers: CustomerField[] }) {
const initialState = { message: null, errors: [] };

View File

@@ -1,5 +1,6 @@
{
"compilerOptions": {
"types": ["react-dom/experimental"],
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,