mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
fix pushTransition for transition tracing (#24338)
We forgot to move pushTransition out from the enableCache flag in #24321 in a place that both transition tracing and cache need to push transitions. Move it out from behind the enableCache to prepare for the next PRs.
This commit is contained in:
@@ -748,14 +748,16 @@ function updateOffscreenComponent(
|
||||
|
||||
subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes);
|
||||
|
||||
let prevCachePool = null;
|
||||
if (enableCache) {
|
||||
// If the render that spawned this one accessed the cache pool, resume
|
||||
// using the same cache. Unless the parent changed, since that means
|
||||
// there was a refresh.
|
||||
const prevCachePool = prevState.cachePool;
|
||||
pushTransition(workInProgress, prevCachePool, null);
|
||||
prevCachePool = prevState.cachePool;
|
||||
}
|
||||
|
||||
pushTransition(workInProgress, prevCachePool, null);
|
||||
|
||||
// Since we're not hidden anymore, reset the state
|
||||
workInProgress.memoizedState = null;
|
||||
} else {
|
||||
|
||||
@@ -748,14 +748,16 @@ function updateOffscreenComponent(
|
||||
|
||||
subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes);
|
||||
|
||||
let prevCachePool = null;
|
||||
if (enableCache) {
|
||||
// If the render that spawned this one accessed the cache pool, resume
|
||||
// using the same cache. Unless the parent changed, since that means
|
||||
// there was a refresh.
|
||||
const prevCachePool = prevState.cachePool;
|
||||
pushTransition(workInProgress, prevCachePool, null);
|
||||
prevCachePool = prevState.cachePool;
|
||||
}
|
||||
|
||||
pushTransition(workInProgress, prevCachePool, null);
|
||||
|
||||
// Since we're not hidden anymore, reset the state
|
||||
workInProgress.memoizedState = null;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user