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 visible (Hide)

react-hook-form - Version 3.28.5

Published by bluebill1049 almost 5 years ago

😞 sorry I broked custom register (patched) register function now return unregister to work closer with react-hook-form-input on top of that you can unregister during useEffect now

useEffect(() => {
  const unregister = register({ name: 'test' });

  return () => unregister;
}, [register])

🐞 fix default watch value bug (#568)

react-hook-form - Version 3.28.4

Published by bluebill1049 almost 5 years ago

🐞 fix #553 setValue issue with schema validation (#554)
✌🏻 make register return unregister (#556)
πŸ₯‚ fix #555 support all primitive types for custom fields (#560)

react-hook-form - Version 3.28.3

Published by bluebill1049 almost 5 years ago

🐞 fix #547 around isValid after reset (#552)
πŸ˜₯ fix error message type (#544)

react-hook-form - Version 3.28.2

Published by bluebill1049 almost 5 years ago

πŸ₯‚ improve setError during useEffect as dependency (#520)
πŸ’…πŸ» wrap render state update with isUnmount guard (#527)
πŸ‘Ή fix #531 issue around lose input focus (#533)
πŸ˜“ fix type on ValidateResult by remove promise

react-hook-form - Version 3.28.1

Published by bluebill1049 almost 5 years ago

πŸ˜₯patch setError type

react-hook-form - Version 3.28.0

Published by bluebill1049 almost 5 years ago

✨ Feature: support multiple errors for single field (#430)

useForm({ validateCriteriaMode: 'all' })

<input name="test" ref={register({ required: true, minLength: 10, pattern: /\d+/gi })} />

all validation errors will display together when both valiation failed.

✨ Feature/array of checkboxes (#500) Thanks to @ldanet ❀️

<input name="test" type="checkbox" value="a" />
<input name="test" type="checkbox" value="b" />

Finally, we can support checkbox with same name, check both values will return ['a', 'b']

πŸ”¨ validate function return type to removed void (This solve problem for error message due to type void)
validate: value => { }; // you need to return string or boolean ❌
validate: value => { return false; } βœ…

🐞 close #516 make sure watch return consistent default value (#517)
🐞 close #513 fix trigger validate error message (#514)
🐞 close #510 reset bug with onChange (#512)
πŸ”¦ clean up types (#495)
πŸ₯‚ Reset accepts partial FormValues (#482)
βœ‚οΈ remove API validationFields (#484)
validationFields optional argument will no longer be supported and use unregister instead

react-hook-form - Version 3.27.0

Published by bluebill1049 almost 5 years ago

✨ New Feature: setErrors support multiple errors at once

const { setError } = useForm();

setError([
  {
    type: 'test',
    name: 'input',
    message: 'wow',
  },
  {
    type: 'test1',
    name: 'input1',
    message: 'wow1',
  },
])

🐞 fix #456 fix setValue to re-render when necessary (read more here)
🐞 fix #440 prevents field names from hanging around in the valid fields
🐞 fix pattern/required issue (#474)
πŸ™πŸ» Improve handle submit with try-finally (#478)

react-hook-form - Version 3.26.5

Published by bluebill1049 almost 5 years ago

🐞 patch #445 fix register cache issue (#444)
🐞 patch #436 watch data inconsistent issue (#439)
🐞 patch #440 use validation schema error instead of picking individual errors
🐞 patch isValid computed incorrectly when dynamically adding required fields
🏎 performance enhancement for setValue and triggerValidation by reduce re-rendering
🀘 remove react-dom from peer dependency #450

react-hook-form - Version 3.26.4

Published by bluebill1049 almost 5 years ago

🐞patch issue around watch API #436 #434

react-hook-form - Version 3.26.3

Published by bluebill1049 almost 5 years ago

πŸ‹πŸ»β€β™€οΈ Patch [React Native] Property 'Proxy' doesn't exist #433
βš’ Patch build issue with typescript (#426)

react-hook-form - Version 3.26.2

Published by bluebill1049 almost 5 years ago

🐞fix dirty and isValid issue with onBlur mode (#417)

react-hook-form - Version 3.26.1

Published by bluebill1049 almost 5 years ago

🐞 fix a bug on re-render when there is no validation rule attached to an input (further improve rendering)

react-hook-form - Version 3.26.0

Published by bluebill1049 almost 5 years ago

πŸ”₯ Massive performance enhancement! #407 thanks to @barrymay @JeromeDeLeon

with this minor version, if your form is not reading attributes from formState, then your form should receive even less re-render and free performance boost. eg:

const { register, handleSbmit } = useform(); 
// by default your form will not get re-render at all until submit, because your validation is onSubmit and you are not reading any formState

🐞 Properly nest getValues for defaultValue #410

react-hook-form - Version 3.25.0

Published by bluebill1049 almost 5 years ago

Important:
🐞 Fix touched to the only trigger during onBlur event
πŸ˜₯ I sincerely apologize to all the users, this is my bad understanding of touched. This bug was introduced on day 1 when react-hook-form introduced formState.
🐞 Fix dependencies during useEffect with register and unregister #394
🐞 Fix isValid issue with validationFields #389
🐞 Consistency with isValid under onSubmit mode always return false on form mount #389
πŸ₯‚ Improve typescript support for react-native custom register #381
πŸƒβ€β™‚οΈ Abort early for validate function (consistency) #400

react-hook-form - Version 3.24.1

Published by bluebill1049 about 5 years ago

🐞 Fix a bug with custom register when required: true
🐞 Patch issue with react-native #369
❀️ Type improvement #367 #368

react-hook-form - Version 3.24.0

Published by bluebill1049 about 5 years ago

❀️ Type improvement #358 #360
🀘 New Feature on reValidateMode #362

Default re-validate error is still onChange, however now you can config how re-validate gets triggered:

useForm({
  mode: 'onBlur', 
  reValidateMode: 'onBLur',
})
react-hook-form - Version 3.23.18

Published by bluebill1049 about 5 years ago

🐞 close #344 fix schema validation with focus (#346)
🐞 close #345 issue with watch causing dirty not update (#347)

react-hook-form - Version 3.23.17

Published by bluebill1049 about 5 years ago

🀞🏻 improve react-native check for set value

react-hook-form - Version 3.23.16

Published by bluebill1049 about 5 years ago

🐞 prevent crash on react native: can't find variable HTMLElement in ReactNative (#339)

react-hook-form - Version 3.23.15

Published by bluebill1049 about 5 years ago

πŸ˜… sorry for the frequent patching, context API got me couple extra try to get it working
🐞 patch on form context and only memo methods and not errors and formState