From 64983aab5d4dbd99ca06bb85e69bb193928ea0c7 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Mon, 29 Mar 2021 13:20:40 -0500 Subject: [PATCH] Remove redundant setUpdatePriority call (#21127) See removed TODO comment. This call is no longer necessary because we use the dispatcher to track whether we're inside a transition, not the event priority. --- packages/react-reconciler/src/ReactFiberHooks.new.js | 6 ------ packages/react-reconciler/src/ReactFiberHooks.old.js | 6 ------ 2 files changed, 12 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberHooks.new.js b/packages/react-reconciler/src/ReactFiberHooks.new.js index 0c7e2e4846d8f..cbb755540e28d 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.new.js +++ b/packages/react-reconciler/src/ReactFiberHooks.new.js @@ -49,7 +49,6 @@ import { markRootMutableRead, } from './ReactFiberLane.new'; import { - DefaultEventPriority, ContinuousEventPriority, getCurrentUpdatePriority, setCurrentUpdatePriority, @@ -1712,11 +1711,6 @@ function startTransition(setPending, callback) { setPending(true); - // TODO: Can remove this. Was only necessary because we used to give - // different behavior to transitions without a config object. Now they are - // all treated the same. - setCurrentUpdatePriority(DefaultEventPriority); - const prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = 1; try { diff --git a/packages/react-reconciler/src/ReactFiberHooks.old.js b/packages/react-reconciler/src/ReactFiberHooks.old.js index 6d5d355f0d711..3c7e87d02dc6f 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.old.js +++ b/packages/react-reconciler/src/ReactFiberHooks.old.js @@ -49,7 +49,6 @@ import { markRootMutableRead, } from './ReactFiberLane.old'; import { - DefaultEventPriority, ContinuousEventPriority, getCurrentUpdatePriority, setCurrentUpdatePriority, @@ -1712,11 +1711,6 @@ function startTransition(setPending, callback) { setPending(true); - // TODO: Can remove this. Was only necessary because we used to give - // different behavior to transitions without a config object. Now they are - // all treated the same. - setCurrentUpdatePriority(DefaultEventPriority); - const prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = 1; try {