@samitouri / QOS-React-2 / commits / 54f17e490f

[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.

Luna Ruan committed Jun 14, 2022 at 11:48 UTC 54f17e490f8b8f39ef9f296c87cd0fba217ce28c
2 files changed +8 -8
packages/react-reconciler/src/ReactFiberTransition.new.js
+4 -4
@@ -139,13 +139,13 @@ export function pushTransition(
139
140 export function popTransition(workInProgress: Fiber, current: Fiber | null) {
141 if (current !== null) {
142 - if (enableCache) {
143 - pop(resumedCache, workInProgress);
144 - }
145 -
142 if (enableTransitionTracing) {
143 pop(transitionStack, workInProgress);
144 }
145 +
146 + if (enableCache) {
147 + pop(resumedCache, workInProgress);
148 + }
149 }
150 }
151
packages/react-reconciler/src/ReactFiberTransition.old.js
+4 -4
@@ -139,13 +139,13 @@ export function pushTransition(
139
140 export function popTransition(workInProgress: Fiber, current: Fiber | null) {
141 if (current !== null) {
142 - if (enableCache) {
143 - pop(resumedCache, workInProgress);
144 - }
145 -
142 if (enableTransitionTracing) {
143 pop(transitionStack, workInProgress);
144 }
145 +
146 + if (enableCache) {
147 + pop(resumedCache, workInProgress);
148 + }
149 }
150 }
151