From 5b64da853fc0fee5752248070a1e30b6024d5107 Mon Sep 17 00:00:00 2001 From: Corey Phillips Date: Fri, 26 Jan 2024 09:38:19 -0500 Subject: [PATCH] fix(wallet): Remove dep from usEffect in Amount component --- src/screens/Wallets/Send/Amount.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/screens/Wallets/Send/Amount.tsx b/src/screens/Wallets/Send/Amount.tsx index f98e0a4f9..af790de22 100644 --- a/src/screens/Wallets/Send/Amount.tsx +++ b/src/screens/Wallets/Send/Amount.tsx @@ -125,13 +125,9 @@ const Amount = ({ navigation }: SendScreenProps<'Amount'>): ReactElement => { useEffect(() => { const result = getNumberPadText(outputAmount, unit); setText(result); - }, [ - transaction.outputs, - outputAmount, - selectedWallet, - selectedNetwork, - unit, - ]); + // Only update this if the outputs/wallet/network changes, so we can ignore unit in the dependency array. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [transaction.outputs, outputAmount, selectedWallet, selectedNetwork]); const amount = useMemo((): number => { return convertToSats(text, unit);