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.2.2

Published by bluebill1049 almost 5 years ago

  • patch issue around nested array error not been cleared
react-hook-form - Version 4.2.1

Published by bluebill1049 almost 5 years ago

fix #722 validation with schema validation (#723)

react-hook-form - Version 4.2.0

Published by bluebill1049 almost 5 years ago

✨ add ErrorMessage component (#715) @kotarella1110

<ErrorMessage name="firstName" errors={errors} />

🐞 fix Controller component props and event names (#718)
πŸ‘¨πŸ»β€πŸ’» fix #716 clear error object when it is empty (#717)
🐞 fix #712 setValue path type (#714)

react-hook-form - Version 4.1.0

Published by bluebill1049 almost 5 years ago

πŸ₯‚ fix #710 change touched from array to object (#711)

  • change formState touched from array to object with better type support

πŸ‘¨β€πŸ« improve controller with inner props override rest props

react-hook-form - Version 4.0.1

Published by bluebill1049 almost 5 years ago

✌️close #700 improve controller with defaultValue (#701)
🐞fix #704 only run validate schema when reading isValid state (#705)

react-hook-form - Version 4.0.0

Published by bluebill1049 almost 5 years ago

πŸ₯‚ New feature

  • control: this will be the prop pass to RHFInput

we probably can skip this hack too: https://github.com/react-hook-form/react-hook-form/pull/635

<RHF control={control} name="test" />

https://github.com/react-hook-form/react-hook-form-input/pull/45


  • move RHFInput into the main repo and rename it to Controller

https://github.com/react-hook-form/react-hook-form-input

<Controller control={control} name="test" />

πŸ”¨ Breaking and improved changes

  • ✨improve module exports:

(we will export all types as well)

import { useForm } from 'react-hook-form';

🚨import useForm from 'react-hook-form'; will no longer work


  • ✨nested errors object and better typescript support
type form = {
  yourDetail: {
    firstName: string,
  }
}

errors?.yourDetail?.firstName

🚨no more flat errors :-) better TS support


  • ✨triggerValidation argument change from Object, Object[] to String, String[]
triggerValidation('firstName');
triggerValidation(['firstName', 'lastName']);

🚨triggerValidation({ name: 'test', value: 'test' }); no longer work


  • ✨watch support { nest: boolean }
watch(); // { 'test.firstName': 'bill' }
watch({ nest: true }); // { test: { firstName: 'bill' } }

  • ✨improve custom register
register('test', { required: true });

🚨register({ name: 'test'}) => register('test')


  • ✨setError support nested object
setError('yourDetail.firstName', 'test');
errors.yourDetails.firstName;

🚨setError('yourDetail.firstName') no longer output flat errors object


handleSubmit no longer rerun array inputs contains undefined or null


βœ‚οΈ API removed:

  • validationSchemaOption: hardly anyone want to use validation with abort early, or change the config.

Thanks to @JeromeDeLeon @kotarella1110 @umidbekkarimov @bopfer

react-hook-form - Version 3.29.4

Published by bluebill1049 almost 5 years ago

πŸ₯‚ required attribute will check for boolean false (#682)

react-hook-form - Version 3.29.3

Published by bluebill1049 almost 5 years ago

🐞 fix #670 reset issue with context (#673)

react-hook-form - Version 3.29.2

Published by bluebill1049 almost 5 years ago

🐞 fix reset with default values (#667)

react-hook-form - Version 3.29.1

Published by bluebill1049 almost 5 years ago

✌🏻 close #637 isValid with reset (#663)

react-hook-form - Version 3.29.0

Published by bluebill1049 almost 5 years ago

πŸ‘ fix #646 fix re-render issue (#647)
πŸ’…πŸ» fix #645 issue around zero in front of number (#649)
πŸ™πŸ» fixing checkbox dynamic rendering (#654)
🐞 fix #650 reset all fields reference (#652)
πŸ₯‚ fix isValid with reset api (#657)
🐞 fix #655 nativeValidation register's value and message (#658)

react-hook-form - Version 3.28.15

Published by bluebill1049 almost 5 years ago

πŸ₯‚ properly fixed isValid formState with schema and build-in validation. (sorry this is a long dragged issue)

  • proper tracking with isValid during register phase
  • tracking when input removed
  • added automation tests

πŸ“– Story:
The challenge for me was to track form valid state during render phase, because RHF embrace uncontrolled inputs, so users can provide default value during render phase and we need to track valid on the fly, and this took me quite few attend to get it right.

❀️ Thanks:
@krnlde have been amazing on report issues and helping on testing. much appreciated your support!
@sergiors same thanks goes to you for helping on testing as well.

react-hook-form - Version 3.28.14

Published by bluebill1049 almost 5 years ago

🌲 improve attribute read (#634)
🐞 fix #631 with revalidating submit mode (#632)
πŸ‘“ close #579 fix typescript usage support (#630)

react-hook-form - Version 3.28.13

Published by bluebill1049 almost 5 years ago

✌️ close #612 & Improve variable naming (#629)
🐞 close #627 isValid with validation schema (#628)

react-hook-form - Version 3.28.12

Published by bluebill1049 almost 5 years ago

🐞 fix scheme isValid (#626)
🐞 close #617 fix validate function with cached ref (#622)
πŸ˜“ register into field issue with isValid (#621)
πŸ™πŸ» fix isValid when there is no input validation (#614)

react-hook-form - Version 3.28.11

Published by bluebill1049 almost 5 years ago

🐞 fix #603 isValid issue (#604)
πŸ˜“ fix: fix async validate type (#602)

react-hook-form - Version 3.28.10

Published by bluebill1049 almost 5 years ago

πŸ₯ƒ Infer return type of watch method when possible (#590)
🐞 fix default value with register input when node remove (#592)
✌️ close #589 remove value and message for validate function (#595)
πŸ’ͺ remove schema related react ref (#596)
πŸ˜“ add handleSubmit back to the contextType
🐞 fix invalid with custom error during handleSubmit (#601)
βœ‚οΈ remove delete keyword in the code base (#599)

react-hook-form - Version 3.28.9

Published by bluebill1049 almost 5 years ago

🐞 close #587 issue with onBlur validation (#588)
🐞 fix #575 triggerValidation typescript

react-hook-form - Version 3.28.8

Published by bluebill1049 almost 5 years ago

πŸ₯‚ close #580 to support required with value and message
🐞 fix #557 setValue re-render with schema validation (#574)
🐞 fix #581 focus issue with checkbox and radio (#582)
🐞 close #584 remove checkbox reference after removing (#586)

react-hook-form - Version 3.28.7

Published by bluebill1049 almost 5 years ago

πŸ˜₯revert return unregister function from register, sorry it cause issue around register