implement review comments
This commit is contained in:
parent
f2c26a90c3
commit
bb69f40a46
|
@ -119,20 +119,19 @@
|
|||
|
||||
const clearValue = () => {
|
||||
const { fieldState } = fieldMap[field]
|
||||
const newValue = initialValues[field] ?? defaultValue;
|
||||
fieldState.update(state => {
|
||||
state.value = defaultValue
|
||||
state.value = newValue
|
||||
state.error = null
|
||||
return state
|
||||
})
|
||||
|
||||
formState.update(state => {
|
||||
state.values = { ...state.values, [field]: defaultValue }
|
||||
state.values = { ...state.values, [field]: newValue }
|
||||
delete state.errors[field]
|
||||
state.valid = Object.keys(state.errors).length === 0
|
||||
return state
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue