[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.
Sebastian Markbåge committed
Aug 12, 2025 at 21:42 UTC
f1222f76521fa7645badaa0c972ad4b2b1dc0b78
1 file changed
+1
-1
packages/react-reconciler/src/ReactFiberCommitWork.js
+1
-1
@@ -1894,7 +1894,6 @@ function attachSuspenseRetryListeners(
1894
const retryCache = getRetryCache(finishedWork);
1895
wakeables.forEach(wakeable => {
1896
// Memoize using the boundary fiber to prevent redundant listeners.
1897
- const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
1897
if (!retryCache.has(wakeable)) {
1898
retryCache.add(wakeable);
1899
@@ -1911,6 +1910,7 @@ function attachSuspenseRetryListeners(
1910
}
1911
}
1912
1913
+ const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
1914
wakeable.then(retry, retry);
1915
}
1916
});