diff --git a/src/atomWithFormControls.ts b/src/atomWithFormControls.ts index a3816b7..8547d8c 100644 --- a/src/atomWithFormControls.ts +++ b/src/atomWithFormControls.ts @@ -1,4 +1,4 @@ -import { WritableAtom, atom } from 'jotai/vanilla'; +import { atom, WritableAtom } from 'jotai/vanilla'; import type { ExtractTypeOfValidatorValue, Validator, @@ -19,7 +19,7 @@ export type ActionableNext = { export type FormControls = { isValid: boolean; fieldErrors: { - [k: string]: any; + [k in Keys]: string | Error | any; }; touched: Record; focused: Record; diff --git a/src/atomWithValidate.ts b/src/atomWithValidate.ts index de9fc74..0e18930 100644 --- a/src/atomWithValidate.ts +++ b/src/atomWithValidate.ts @@ -1,5 +1,5 @@ import { atom } from 'jotai/vanilla'; -import type { WritableAtom, SetStateAction } from 'jotai/vanilla'; +import type { SetStateAction, WritableAtom } from 'jotai/vanilla'; export type CommonState = { value: Value;