feat: exposes FieldWithPath type for reuse

This commit is contained in:
James
2022-01-07 14:21:36 -05:00
parent c67a68f9d8
commit df3a83634f
3 changed files with 3 additions and 0 deletions

View File

@@ -127,6 +127,7 @@ const useField = <T extends unknown>(options: Options): FieldType<T> => {
formSubmitted: submitted, formSubmitted: submitted,
formProcessing: processing, formProcessing: processing,
setValue, setValue,
initialValue,
}; };
}; };

View File

@@ -17,4 +17,5 @@ export type FieldType<T> = {
formSubmitted: boolean formSubmitted: boolean
formProcessing: boolean formProcessing: boolean
setValue: (val: unknown, modifyForm?: boolean) => void setValue: (val: unknown, modifyForm?: boolean) => void
initialValue?: T
} }

1
types.d.ts vendored
View File

@@ -29,6 +29,7 @@ export {
export { export {
Field, Field,
FieldHook, FieldHook,
FieldWithPath,
FieldAccess, FieldAccess,
RichTextCustomElement, RichTextCustomElement,
RichTextCustomLeaf, RichTextCustomLeaf,