Clear form field error when re-registering the same field
This commit is contained in:
parent
700e36854c
commit
4f114e42db
|
@ -73,9 +73,14 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip if we've already registered this field
|
// If we've already registered this field then wipe any errors and
|
||||||
|
// return the existing field
|
||||||
const existingField = getField(field)
|
const existingField = getField(field)
|
||||||
if (existingField) {
|
if (existingField) {
|
||||||
|
existingField.update(state => {
|
||||||
|
state.fieldState.error = null
|
||||||
|
return state
|
||||||
|
})
|
||||||
return existingField
|
return existingField
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue