From 1bbb83c2808470e00e5e95988151c5439234c337 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Tue, 10 Nov 2020 16:41:54 -0600 Subject: [PATCH] Fix bug preventing jest from ever finishing on build server --- app/javascript/components/formik/MoneyTextField.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/components/formik/MoneyTextField.tsx b/app/javascript/components/formik/MoneyTextField.tsx index 96be8d75..32f1303f 100644 --- a/app/javascript/components/formik/MoneyTextField.tsx +++ b/app/javascript/components/formik/MoneyTextField.tsx @@ -54,7 +54,7 @@ export type IMoneyTextFieldProps = Omit & */ function MoneyTextField({ children, form, field, currencyDisplay, useGrouping, allowEmpty, selectAllOnFocus, ...props }:IMoneyTextFieldProps) : JSX.Element { const {name:fieldName, value} = field; - + const {setFieldValue} = form; const inputRef = useRef(); const {currency} = value; @@ -67,9 +67,9 @@ function MoneyTextField({ children, form, field, currencyDisplay, useGrouping, a useEffect(() => { - form.setFieldValue(fieldName, Money.fromCents(valueInCents, currency)); + setFieldValue(fieldName, Money.fromCents(valueInCents, currency)); - }, [fieldName, valueInCents, currency, form]); + }, [fieldName, valueInCents, currency, setFieldValue]); return