mirror of
https://github.com/vercel/next-learn.git
synced 2026-06-23 20:55:50 +00:00
add react-dom/experimental to out types in tsconfig in order to work around the useFormState ts error
This commit is contained in:
@@ -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: [] };
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"types": ["react-dom/experimental"],
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
|
||||
Reference in New Issue
Block a user