1
0
Fork 0
mirror of synced 2024-07-03 05:20:32 +12:00

Clear form field error when re-registering the same field

This commit is contained in:
Andrew Kingston 2021-08-19 13:41:18 +01:00
parent 7ba8bc6a19
commit c3cf48c268

View file

@ -73,9 +73,14 @@
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)
if (existingField) {
existingField.update(state => {
state.fieldState.error = null
return state
})
return existingField
}