Skip to content

Commit 1ddf530

Browse files
Andaristerikras
authored andcommitted
Cleanup onBlur dependencies (#546)
* Cleanup onBlur dependencies * Removed comment about ternary
1 parent f3e7c17 commit 1ddf530

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/useField.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,12 @@ function useField<FormValues: FormValuesShape>(
126126
* before calling `onBlur()`, but before the field has had a chance to receive
127127
* the value update from Final Form.
128128
*/
129-
const fieldState = form.getFieldState(state.name)
130-
// this ternary is primarily to appease the Flow gods
131-
// istanbul ignore next
132-
state.change(
133-
format(fieldState ? fieldState.value : state.value, state.name)
134-
)
129+
const fieldState: any = form.getFieldState(state.name)
130+
state.change(format(fieldState.value, state.name))
135131
}
136132
},
137133
// eslint-disable-next-line react-hooks/exhaustive-deps
138-
[state.name, state.value, format, formatOnBlur]
134+
[state.name, format, formatOnBlur]
139135
),
140136
onChange: React.useCallback(
141137
(event: SyntheticInputEvent<*> | any) => {

0 commit comments

Comments
 (0)