Changelog History
Page 14
-
v4.6.2 Changes
January 21, 2020๐ฑ ๐ fix field array input dirty while onChange
๐ฑ ๐ fix issue on field array default value compare
๐ โ๐ป fix issue on clearError and remove codesandbox from npm (#878) -
v4.6.1 Changes
January 21, 2020๐ฑ ๐ฅ fix useFieldArray issue with default value (#876)
-
v4.6.0 Changes
January 21, 2020๐ฑ ๐ remove Controller's onBlur and use triggerValidation API instead (#862)
๐ฑ ๐ fix #833 field array dirty formState (#855)
๐ฑ ๐ close #864 check typeof undefined inline
๐ ๐ fix #864 performance api for SSR (#865)
๐ฑ ๐ fix #868 regsiter dep issue (#869)
๐ฑ ๐ remove extra variable in Controller
๐ฑ ๐ญ fix controller nested error (#863) @cdagli -
v4.5.6 Changes
January 19, 2020๐ฑ ๐ป fix issue around register during useFieldArray (#861)
๐ฑ ๐บ fix assign empty filelist (#849)
๐ฑ ๐ improve type for control (#853) @kotarella1110 -
v4.5.5 Changes
January 16, 2020๐ฑ ๐ฌ fix a mistake on argument order with
dirty
check on useFieldArray -
v4.5.4 Changes
January 16, 2020๐ฑ โค๏ธ improve useFieldArray (#846) @kotarella1110
๐ฑ ๐ฆ close #833 dirty value with useFieldArray (#839) -
v4.5.3 Changes
January 15, 2020๐ ๐ช๐ป support name of dot syntax for useFieldArray (#840) @kotarella1110
๐ช๐ป allow empty object in prepend, append and insert. (#830) @tanmen
๐ฑ ๐ Allows to clean up files (#835) @hekkim
๐ฑ ๐ fix #836 revalidateMode onChange issue (#838)
๐ฑ ๐ fix issue around reset with fieldArray (#842) -
v4.5.2 Changes
January 14, 2020๐ฑ ๐ Fix/use field array with controller and reset (#831)
-
v4.5.1 Changes
January 14, 2020 -
v4.5.0 Changes
January 14, 2020๐ฑ ๐ useFieldArray (#768)
Custom hook for working with Field Arrays (dynamic inputs).
function Test() { const { control, register } = useForm(); const { fields, append, prepend, remove, swap, move, insert } = useFieldArray( { control, // control props comes from useForm (optional: if you are using FormContext) name: "test" // unique name for your Field Array } );
return ( <> {fields.map((field, index) => { return ( {/* important: using id from to track item added or removed */} ); })} </> ); }
Name Type Description ๐ fields object & { id: string } append (obj: any) => void Append input/inputs to the end of your fields prepend (obj: any) => void Prepend input/inputs to the start of your fields insert (index: number, value: any) => void Insert input/inputs at particular position. swap (from: number, to: number) => void Swap input/inputs position. ๐ move (from: number, to: number) => void ๐ remove (index?: number) => void