react-hook-form

📋 React Hooks for form state management and validation (Web + React Native)

MIT License

Downloads
25.6M
Stars
39.4K
Committers
318

Bot releases are hidden (Show)

react-hook-form - Version 4.6.2

Published by bluebill1049 over 4 years ago

🐞 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)

react-hook-form - Version 4.6.1

Published by bluebill1049 almost 5 years ago

ðŸĨ‚ fix useFieldArray issue with default value (#876)

react-hook-form - Version 4.6.0

Published by bluebill1049 almost 5 years ago

🎇 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

react-hook-form - Version 4.5.6

Published by bluebill1049 almost 5 years ago

ðŸ‘ŧ fix issue around register during useFieldArray (#861)
👚 fix assign empty filelist (#849)
👊 improve type for control (#853) @kotarella1110

react-hook-form - Version 4.5.5

Published by bluebill1049 almost 5 years ago

😎 fix a mistake on argument order with dirty check on useFieldArray

react-hook-form - Version 4.5.4

Published by bluebill1049 almost 5 years ago

âĪïļ improve useFieldArray (#846) @kotarella1110
ðŸ”Ķ close #833 dirty value with useFieldArray (#839)

react-hook-form - Version 4.5.3

Published by bluebill1049 almost 5 years ago

💊ðŸŧ 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)

react-hook-form - Version 4.5.2

Published by bluebill1049 almost 5 years ago

🐞 Fix/use field array with controller and reset (#831)

react-hook-form - Version 4.5.1

Published by bluebill1049 almost 5 years ago

fix #821 ssr issue (#828)

react-hook-form - Version 4.5.0

Published by bluebill1049 almost 5 years ago

💈 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 (
          <div key={field.id}> {/* important: using id from to track item added or removed */}
            <input name={`test[${index}}]`} ref={register} />
          </div>
        );
      })}
    </>
  );
}
Name Type Description
fields object & { id: string } This object is the source of truth to map and render inputs.Important: because each inputs can be uncontrolled, id is required with mapped components to help React identify which items have changed, are added, or are removed.eg: {fields.map(d => )}
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 Move input/inputs to another position.Note: difference between move and swap, keep calling move will push input/inputs in a circle, while swap only change two input/inputs' position.
remove (index?: number) => void Remove input/inputs at particular position, or remove all when no index is provided.
react-hook-form - Version 4.4.8

Published by bluebill1049 almost 5 years ago

😅 fix an issue around reset with Controller https://github.com/react-hook-form/react-hook-form/issues/810

react-hook-form - Version 4.4.7

Published by bluebill1049 almost 5 years ago

ðŸ‘ĻðŸŧ‍ðŸ’ŧ fix #801 controller register issue (#805)
🏞 fix typescript error type in array (#804)

react-hook-form - Version 4.4.6

Published by bluebill1049 almost 5 years ago

fix schema omit null undefined from errors

  • which cause array errors not print in the correct order (#799)
react-hook-form - Version 4.4.5

Published by bluebill1049 almost 5 years ago

✌ðŸŧ fix #793 with get method (#795)
✌ðŸŧ fix missing deep partial type (#794)
✌ðŸŧ fix #791 issue with clear field array errors

react-hook-form - Version 4.4.4

Published by bluebill1049 almost 5 years ago

🙏ðŸŧ improve setValue for file type input (#790) @brennedith
🐞 fix contextTypes.ts with its type (#787) @bopfer
ðŸ‘đ include name as dep for controller (#781)

react-hook-form - Version 4.4.3

Published by bluebill1049 almost 5 years ago

🐞 Fix type for rest props in Controller (#771) @JeromeDeLeon
🌜 close #775 controller default to undefined (#776)

react-hook-form - Version 4.4.2

Published by bluebill1049 almost 5 years ago

Removed (until we find better solution for report missing field) -> ðŸšĶ add runtime field name check and add unit test (#756)

react-hook-form - Version 4.4.1

Published by bluebill1049 almost 5 years ago

ðŸĪš close #757 with null and undefined check for value (#758)

react-hook-form - Version 4.4.0

Published by bluebill1049 almost 5 years ago

🚧 support multiple errors for ErrorMessage component (#750) @kotarella1110
ðŸšĶ add runtime field name check and add unit test (#756)
✏ïļ fix code review comment (#751)
🐞 fix #752 default value after reset (#753)
🐞 fix #746 focus error issue (#748)

react-hook-form - Version 4.3.0

Published by bluebill1049 almost 5 years ago

âœĻ Support custom value name (#727) Thanks to @JeromeDeLeon

<Controller control={control} valueName="checked" />

ðŸ—ŋ fix #728 Date type support (#744)
✌ïļ close #740 making control prop optional (#741)
âœĻ close #730 to support min and max for custom register (#731)