From 54f17e490f8b8f39ef9f296c87cd0fba217ce28c Mon Sep 17 00:00:00 2001 From: Luna Ruan Date: Tue, 14 Jun 2022 11:48:01 -0700 Subject: [PATCH] [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. --- packages/react-reconciler/src/ReactFiberTransition.new.js | 8 ++++---- packages/react-reconciler/src/ReactFiberTransition.old.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberTransition.new.js b/packages/react-reconciler/src/ReactFiberTransition.new.js index c855cb3953..bb5f5d93d2 100644 --- a/packages/react-reconciler/src/ReactFiberTransition.new.js +++ b/packages/react-reconciler/src/ReactFiberTransition.new.js @@ -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); + } } } diff --git a/packages/react-reconciler/src/ReactFiberTransition.old.js b/packages/react-reconciler/src/ReactFiberTransition.old.js index ed73d47166..1abb0e2180 100644 --- a/packages/react-reconciler/src/ReactFiberTransition.old.js +++ b/packages/react-reconciler/src/ReactFiberTransition.old.js @@ -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); + } } }