mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01: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:
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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user