mirror of
https://github.com/cupcakearmy/formhero.git
synced 2024-12-22 16:16:24 +00:00
testing for setForm, setField and setErrors
This commit is contained in:
parent
c62b7b0882
commit
e5eb69057a
@ -13,7 +13,7 @@ const initial = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Index: React.FC = () => {
|
const Index: React.FC = () => {
|
||||||
const { field, form, errors, isValid, setForm, setErrors } = useForm(initial, {
|
const { field, form, errors, isValid, setForm, setErrors, setField } = useForm(initial, {
|
||||||
username: [
|
username: [
|
||||||
/^test/,
|
/^test/,
|
||||||
{
|
{
|
||||||
@ -37,6 +37,7 @@ const Index: React.FC = () => {
|
|||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
setForm(initial)
|
setForm(initial)
|
||||||
|
setField('username', 'asdf')
|
||||||
}
|
}
|
||||||
|
|
||||||
const error = () => {
|
const error = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user