mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[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.
This commit is contained in:
committed by
GitHub
parent
9baecbf02b
commit
f1222f7652
@@ -1894,7 +1894,6 @@ function attachSuspenseRetryListeners(
|
||||
const retryCache = getRetryCache(finishedWork);
|
||||
wakeables.forEach(wakeable => {
|
||||
// Memoize using the boundary fiber to prevent redundant listeners.
|
||||
const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
|
||||
if (!retryCache.has(wakeable)) {
|
||||
retryCache.add(wakeable);
|
||||
|
||||
@@ -1911,6 +1910,7 @@ function attachSuspenseRetryListeners(
|
||||
}
|
||||
}
|
||||
|
||||
const retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
|
||||
wakeable.then(retry, retry);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user