MCPcopy
hub / github.com/facebook/react / peekCacheFromPool

Function peekCacheFromPool

packages/react-reconciler/src/ReactFiberTransition.js:208–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206 createCursor(null);
207
208function peekCacheFromPool(): Cache | null {
209 // Check if the cache pool already has a cache we can use.
210
211 // If we're rendering inside a Suspense boundary that is currently hidden,
212 // we should use the same cache that we used during the previous render, if
213 // one exists.
214 const cacheResumedFromPreviousRender = resumedCache.current;
215 if (cacheResumedFromPreviousRender !== null) {
216 return cacheResumedFromPreviousRender;
217 }
218
219 // Otherwise, check the root's cache pool.
220 const root = (getWorkInProgressRoot(): any);
221 const cacheFromRootCachePool = root.pooledCache;
222
223 return cacheFromRootCachePool;
224}
225
226export function requestCacheFromPool(renderLanes: Lanes): Cache {
227 // Similar to previous function, except if there's not already a cache in the

Callers 3

requestCacheFromPoolFunction · 0.85
getSuspendedCacheFunction · 0.85

Calls 1

getWorkInProgressRootFunction · 0.90

Tested by

no test coverage detected