Skip to content

Commit f1222f7

Browse files
authored
[Fiber] Don't bind retry listener if it's in the cache (#34183)
This did an unnecessary bind allocation even if there's cache hit.
1 parent 9baecbf commit f1222f7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,6 @@ function attachSuspenseRetryListeners(
18941894
const retryCache = getRetryCache(finishedWork);
18951895
wakeables.forEach(wakeable => {
18961896
// Memoize using the boundary fiber to prevent redundant listeners.
1897-
const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
18981897
if (!retryCache.has(wakeable)) {
18991898
retryCache.add(wakeable);
19001899

@@ -1911,6 +1910,7 @@ function attachSuspenseRetryListeners(
19111910
}
19121911
}
19131912

1913+
const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
19141914
wakeable.then(retry, retry);
19151915
}
19161916
});

0 commit comments

Comments
 (0)