Skip to content

Commit

Permalink
[Transition Tracing] Fix Cache and Transitions Pop Order (#24719)
Browse files Browse the repository at this point in the history
We push the Cache before the transition so we should pop the transition before the cache. This PR fixes this issue.
  • Loading branch information
lunaruan authored Jun 14, 2022
1 parent be229c5 commit 54f17e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/react-reconciler/src/ReactFiberTransition.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ export function pushTransition(

export function popTransition(workInProgress: Fiber, current: Fiber | null) {
if (current !== null) {
if (enableCache) {
pop(resumedCache, workInProgress);
}

if (enableTransitionTracing) {
pop(transitionStack, workInProgress);
}

if (enableCache) {
pop(resumedCache, workInProgress);
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/react-reconciler/src/ReactFiberTransition.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ export function pushTransition(

export function popTransition(workInProgress: Fiber, current: Fiber | null) {
if (current !== null) {
if (enableCache) {
pop(resumedCache, workInProgress);
}

if (enableTransitionTracing) {
pop(transitionStack, workInProgress);
}

if (enableCache) {
pop(resumedCache, workInProgress);
}
}
}

Expand Down

0 comments on commit 54f17e4

Please sign in to comment.