Skip to content

Commit c878f6a

Browse files
author
Nabi
committed
add comment for Search selection bailout
1 parent f1515e9 commit c878f6a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/components/Search/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,10 @@ function Search({
927927
return;
928928
}
929929

930+
// Bail out when the rebuilt selection is deeply equal to the current one. Without this,
931+
// a dep that re-derives to a new reference but the same value re-runs this effect, which
932+
// calls setSelectedTransactions with an equivalent payload and loops until React aborts
933+
// with "Maximum update depth exceeded". See https://github.com/Expensify/App/issues/89588
930934
if (deepEqual(newTransactionList, selectedTransactions)) {
931935
return;
932936
}

0 commit comments

Comments
 (0)