diff --git a/src/components/FormErrorState.tsx b/src/components/FormErrorState.tsx index 7ff6c718..bf2cd6d3 100644 --- a/src/components/FormErrorState.tsx +++ b/src/components/FormErrorState.tsx @@ -118,8 +118,15 @@ export const FormErrorState: React.FunctionComponent = ({ return error; }, callbackRegenValues); - const wasFieldTouched = (id: string) => blurredFieldIds.has(id) || didAttemptSubmission; - const isErrorVisible = (id: string) => wasFieldTouched(id) && erroredFieldIds.has(id); + const wasFieldTouched = useCallback( + (id: string) => blurredFieldIds.has(id) || didAttemptSubmission, + callbackRegenValues + ); + + const isErrorVisible = useCallback( + (id: string) => wasFieldTouched(id) && erroredFieldIds.has(id), + callbackRegenValues + ); const onFocus = useCallback((id: string) => setFocusedFieldId(id), []);