Skip to content

Commit

Permalink
Update comment src/pages/iou/steps/MoneyRequestAmountForm.js
Browse files Browse the repository at this point in the history
Co-authored-by: abdulrahuman5196 <[email protected]>
  • Loading branch information
ygshbht and abdulrahuman5196 authored Oct 23, 2023
1 parent f9e41e1 commit 4bae23f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/iou/steps/MoneyRequestAmountForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
setFormError('');
}

// setCurrentAmount contains another setState making it error-prone. This solution introducing the hasSelectionBeenSet flag was chosen for its simplicity and lower risk of future errors https://github.com/Expensify/App/issues/23300#issuecomment-1766314724.
// setCurrentAmount contains another setState(setSelection) making it error-prone since it is leading to setSelection being called twice for a single setCurrentAmount call. This solution introducing the hasSelectionBeenSet flag was chosen for its simplicity and lower risk of future errors https://github.com/Expensify/App/issues/23300#issuecomment-1766314724.

let hasSelectionBeenSet = false;
setCurrentAmount((prevAmount) => {
Expand Down

0 comments on commit 4bae23f

Please sign in to comment.