✨ 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