testing for setForm, setField and setErrors

This commit is contained in:
cupcakearmy 2019-10-19 16:57:41 +02:00
parent c62b7b0882
commit e5eb69057a

View File

@ -13,7 +13,7 @@ const initial = {
}
const Index: React.FC = () => {
const { field, form, errors, isValid, setForm, setErrors } = useForm(initial, {
const { field, form, errors, isValid, setForm, setErrors, setField } = useForm(initial, {
username: [
/^test/,
{
@ -37,6 +37,7 @@ const Index: React.FC = () => {
const reset = () => {
setForm(initial)
setField('username', 'asdf')
}
const error = () => {