Releases: zackify/validify
Releases · zackify/validify
6.1.1
6.1.0
6.0.4
6.0.3
Moved rules onto the individual inputs! This api feels so much nicer :D
Breaking changes
Change useField calls from:
let { handleChange, handleBlur, value, errors } = useField(props.name);
to
let { handleChange, handleBlur, value, errors } = useField({name: props.name, rules: props.rules});
Change Form validation from:
<Form
values={values}
onValues={setValues}
rules={{
email: [required, email],
date1: [greaterThanDate2],
name: [required],
}}
>
<Input name="email" />
<Input name="name" />
<Input name="date1" />
<Input name="date2" />
<Input name="nested.test" />
<Submit />
</Form>
to
<Form values={values} onValues={setValues}>
<Input name="email" rules={[required, email]} />
<Input name="name" rules={[required]} />
<Input name="date1" rules={[greaterThanDate2]} />
<Input name="date2" />
<Input name="nested.test" />
<Submit />
</Form>
5.7.12
5.7.9
5.7.8
Fix bug with validation:
- hit submit immediately
- tap a field, change the value to be correct, now change it to be invalid. The error wouldn't show until you blur
The fix:
when hitting submit, mark all fields that have rules as blurred, so validation runs on change