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 7.12.0

Published by bluebill1049 about 3 years ago

โŒš UX: useForm config delayError (#5935)

useForm({
  delayError: 500 // delay error appear with 500ms
})

โŒจ๏ธ stricter type check on onChange event type (#6030)
๐Ÿž fix #6035 issue with Controller select toggle inValid state (#6069)
๐Ÿž fix #6055 missing dirtyFields subscribe in useFieldArray actions (#6059)
๐Ÿž fix #6052 miss marking controller as mounted (#6053)

react-hook-form - Version 7.11.1

Published by bluebill1049 over 3 years ago

๐Ÿ› fix #5944 reset issue with unmounted useFieldArray (#5954)
๐Ÿ› fix #5942 case when value is supplied as null/undefined
โŒจ๏ธ close #5928 improve useWatch and watch types (#5945)
๐ŸŽฎ fix #5936 regression with controller value transform (#5937)

react-hook-form - Version 7.11.0

Published by bluebill1049 over 3 years ago

๐Ÿš… update method for useFieldArray (#5835)

const { update } = useFieldArray();

update(0, data); // update an individual field array node

๐Ÿ”„ fix #5911 issue with reset clear flag for Controller (#5912)
โŒจ๏ธ fix #5839 issue with null type with deepMap (#5896)
๐ŸšŒ close #5857 setValue missing await with trigger validation (#5859)
๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป chore: allow readonly tuple in useWatch generic params (#5845)

react-hook-form - Version 7.10.1

Published by bluebill1049 over 3 years ago

๐Ÿ—๏ธ fix #5808 DeepMap extend issue with File (#5813)
๐Ÿ•ต๏ธ fix #5816 variable name typo in useController

react-hook-form - Version 7.10.0

Published by bluebill1049 over 3 years ago

๐ŸŒ deprecated defaultValue at useFieldArray as a required prop (#5636)

function Test() {
  const { control, register } = useForm();
  const { fields, append, prepend, remove, swap, move, insert } = useFieldArray({
    control,
    name: "test",
  });

  return (
    {fields.map((field, index) => (
      <input
        key={field.id} // important to include key with field's id
        {...register(`test.${index}.value`)} 
-        defaultValue={field.value} // no longer required
      />
    ))}
  );
}

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป fix #5787 controller type for defaultValue (#5792)
๐Ÿ˜ฟ fix #5777 regression on unmount defaultValue with shouldUnregister:true (#5778)
๐Ÿ“… close #5724 setValue skip parse date time as object (#5729)
๐ŸŽฎ #5712 enable controller with native validation (#5716)
๐Ÿ› fix spread non-primitive values in nested array fields (#5705)
๐ŸŽช batch single watch update (#5707)
๐ŸŸ๏ธ batch unregister inputs (#5706)
๐Ÿž fix #5699 trigger not focusing first input with error (#5700)

react-hook-form - Version 7.9.0

Published by bluebill1049 over 3 years ago

๐Ÿฅ‡ feature: support browser native form control (#5503)

export default function App() {
  const { register, handleSubmit } = useForm({
    shouldUseNativeValidation: true,
  });
  const onSubmit = (data) => console.log(data);

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input
        {...register("firstName", {
          required: "This is required from bill."
        })}
        autoComplete={"off"}
        placeholder="First Name"
      />
      <input type="submit" />
    </form>
  );
}

๐Ÿž fix #5661 trigger throw error when the field is not found (#5664)
๐Ÿž fix #5678 reset with keep default values with Controller (#5688)

react-hook-form - Version 7.8.9-beta.1

Published by bluebill1049 over 3 years ago

  • fix register input without defaultValue for useFieldArray
react-hook-form - Version 7.8.9-beta.0

Published by bluebill1049 over 3 years ago

  • deprecate defaultValue as required prop for useFieldArray
function Test() {
  const { control, register } = useForm();
  const { fields } = useFieldArray({
    control,
    name: "test",
  });

  return (
    {fields.map((field, index) => (
      <input
        key={field.id} // important to include key with field's id
        {...register(`test.${index}.value`)} 
-        defaultValue={field.value} // make sure to include defaultValue
      />
    ))}
  );
}
react-hook-form - Version 7.8.8

Published by bluebill1049 over 3 years ago

๐Ÿž fix #5627 defaultValue reset inconsistent with setValueAs (#5634)

react-hook-form - Version 7.8.7

Published by bluebill1049 over 3 years ago

๐Ÿž fix #5623 Controller unmount to skip validation (#5624)

react-hook-form - Version 7.8.6

Published by bluebill1049 over 3 years ago

๐Ÿž fix #5611 should not update dirty fields with blur event (#5614)
๐Ÿž fix #5612 trigger() always return true (#5613)

react-hook-form - Version 7.8.5

Published by bluebill1049 over 3 years ago

๐Ÿ’ผ close #5603 to enable nested field array register with useFieldArray
๐Ÿ‘๏ธ improve useController to only return focus method from ref (#5582)
๐Ÿ›๏ธ improve useFieldArray when it's getting unmount and pulling the latest values (#5583)

react-hook-form - Version 7.8.4

Published by bluebill1049 over 3 years ago

๐Ÿž fix #5555 register deeply nested field append with strict mode (#5580)
๐Ÿ› fix #5566 should unregister inputs when useFieldArray unmounted (#5579)
๐Ÿ”ข fix #5568 include . for a precise focus index lookup (#5578)
๐Ÿ•ต๏ธโ€โ™€๏ธ improve logic on register absent inputs (#5556)
๐Ÿ‘ฎ fix #5538 type error with setError shouldFocus

react-hook-form - Version 7.8.3

Published by bluebill1049 over 3 years ago

๐Ÿ› fix #5527 resolver switching (#5530)

react-hook-form - Version 7.8.2

Published by bluebill1049 over 3 years ago

๐Ÿ› fix #5507 register with value issue (#5511)

react-hook-form - Version 6.15.8

Published by bluebill1049 over 3 years ago

๐Ÿ› fix #5506 watch return null value with field array

react-hook-form - Version 7.8.1

Published by bluebill1049 over 3 years ago

๐Ÿ› fix #5499 issue with controller defaultValue overwrite defaultValues at useForm (#5500)

react-hook-form - Version 7.8.0

Published by bluebill1049 over 3 years ago

๐Ÿ› fix #5492 with empty reset with useController setting unmount attribute (#5493)
๐Ÿ‘Œ improve logic on unmount input with ref callback (#5488)
โšœ๏ธ feature: support shouldTouch with setValue (#5181)
โ™ป๏ธ useFieldArray improvement with register value API (#5473)
๐Ÿ’– feature: support register with value (#5380)
๐ŸŒ useFieldArray reduce function (#5471)
๐Ÿช– improve focus logic for field array (#5470)
๐Ÿชข improve register perf and remove duplicated logic (#5469)
๐Ÿงฏ close #5440 remove extra value update (#5442)
๐Ÿ”ฌ remove extra ref assign (#5433)
๐Ÿช Improve isValid form State by removing extra internal formState (#5415)

react-hook-form - Version 7.7.1

Published by bluebill1049 over 3 years ago

๐ŸŽ“ only register absent fields with shouldUnregister: false (#5418)

react-hook-form - Version 7.7.0

Published by bluebill1049 over 3 years ago

๐ŸŒŸ feature: focus with trigger (#4960)

trigger('firstName', { shouldFocus: true})

๐Ÿงผ bubble up the error when thrown in submit handler (#5391)