Skip to content

Commit

Permalink
Fixed dependency array for decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
esh-g committed Oct 2, 2023
1 parent 6ea45f7 commit 7e180d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/iou/steps/MoneyRequestAmountForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
// If the changed currency doesn't support decimals, we can strip the decimals
setNewAmount(MoneyRequestUtils.stripDecimalsFromAmount(currentAmount));

// we want to check validation only when the currency changes
// we want to update only when decimals change (setNewAmount also changes when decimals change).
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currency]);
}, [setNewAmount]);

/**
* Update amount with number or Backspace pressed for BigNumberPad.
Expand Down

0 comments on commit 7e180d7

Please sign in to comment.