From 5dc3e700a11bd40eab99dcfda95b1cd17543747d Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 11 Dec 2023 21:52:27 -0700 Subject: [PATCH] Merge pull request #32884 from Expensify/cmartins-fixAmountReset (cherry picked from commit 4239252d5ace1039fa2aaf8d707f4e5de8523309) --- src/pages/iou/steps/MoneyRequestAmountForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequestAmountForm.js b/src/pages/iou/steps/MoneyRequestAmountForm.js index b4ae00b8e665..6317fd09aa82 100644 --- a/src/pages/iou/steps/MoneyRequestAmountForm.js +++ b/src/pages/iou/steps/MoneyRequestAmountForm.js @@ -123,9 +123,9 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu return; } initializeAmount(amount); - // we want to update the state only when the amount is changed + // we want to re-initialize the state only when the selected tab changes // eslint-disable-next-line react-hooks/exhaustive-deps - }, [amount]); + }, [selectedTab]); /** * Sets the selection and the amount accordingly to the value passed to the input