diff --git a/docs/api/useField.md b/docs/api/useField.md index e5e3dd6aa..16bd82015 100644 --- a/docs/api/useField.md +++ b/docs/api/useField.md @@ -3,7 +3,7 @@ id: useField title: useField() --- -`useField` is a custom React hook that will automagically help you hook up inputs to Formik. You can and should use it to build your own custom input primitives. There are 2 ways to use it. +`useField` is a React hook used to thread Formik behaviors into arbitrary field components. It provides the greatest amount of flexibility for scenarios where `Field` is inappropriate. There are two ways to use it. ## Example diff --git a/packages/formik/src/FieldArray.tsx b/packages/formik/src/FieldArray.tsx index 951a2a491..1e0a4073e 100644 --- a/packages/formik/src/FieldArray.tsx +++ b/packages/formik/src/FieldArray.tsx @@ -30,9 +30,9 @@ export type FieldArrayConfig = { } & SharedRenderProps; export interface ArrayHelpers { /** Imperatively add a value to the end of an array */ - push(obj: X): void; + push(obj: X): void; /** Curried fn to add a value to the end of an array */ - handlePush(obj: X): () => void; + handlePush(obj: X): () => void; /** Imperatively swap two values in an array */ swap: (indexA: number, indexB: number) => void; /** Curried fn to swap two values in an array */ @@ -42,25 +42,25 @@ export interface ArrayHelpers { /** Imperatively move an element in an array to another index */ handleMove: (from: number, to: number) => () => void; /** Imperatively insert an element at a given index into the array */ - insert(index: number, value: X): void; + insert(index: number, value: X): void; /** Curried fn to insert an element at a given index into the array */ - handleInsert(index: number, value: X): () => void; + handleInsert(index: number, value: X): () => void; /** Imperatively replace a value at an index of an array */ - replace(index: number, value: X): void; + replace(index: number, value: X): void; /** Curried fn to replace an element at a given index into the array */ - handleReplace(index: number, value: X): () => void; + handleReplace(index: number, value: X): () => void; /** Imperatively add an element to the beginning of an array and return its length */ - unshift(value: X): number; + unshift(value: X): number; /** Curried fn to add an element to the beginning of an array */ - handleUnshift(value: X): () => void; + handleUnshift(value: X): () => void; /** Curried fn to remove an element at an index of an array */ handleRemove: (index: number) => () => void; /** Curried fn to remove a value from the end of the array */ handlePop: () => () => void; /** Imperatively remove and element at an index of an array */ - remove(index: number): X | undefined; + remove(index: number): X | undefined; /** Imperatively remove and return value from the end of the array */ - pop(): X | undefined; + pop(): X | undefined; } /**