Skip to content

Commit 54f17e4

Browse files
authored
[Transition Tracing] Fix Cache and Transitions Pop Order (#24719)
We push the Cache before the transition so we should pop the transition before the cache. This PR fixes this issue.
1 parent be229c5 commit 54f17e4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/react-reconciler/src/ReactFiberTransition.new.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ export function pushTransition(
139139

140140
export function popTransition(workInProgress: Fiber, current: Fiber | null) {
141141
if (current !== null) {
142-
if (enableCache) {
143-
pop(resumedCache, workInProgress);
144-
}
145-
146142
if (enableTransitionTracing) {
147143
pop(transitionStack, workInProgress);
148144
}
145+
146+
if (enableCache) {
147+
pop(resumedCache, workInProgress);
148+
}
149149
}
150150
}
151151

packages/react-reconciler/src/ReactFiberTransition.old.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ export function pushTransition(
139139

140140
export function popTransition(workInProgress: Fiber, current: Fiber | null) {
141141
if (current !== null) {
142-
if (enableCache) {
143-
pop(resumedCache, workInProgress);
144-
}
145-
146142
if (enableTransitionTracing) {
147143
pop(transitionStack, workInProgress);
148144
}
145+
146+
if (enableCache) {
147+
pop(resumedCache, workInProgress);
148+
}
149149
}
150150
}
151151

0 commit comments

Comments
 (0)