From 72380bdd758e78ac6d17a1fd858ecb50c5fc3170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Thu, 8 Apr 2021 14:14:51 -0400 Subject: [PATCH] Remove unnecessary processUpdateQueue (#21199) We've just initialized the update queue above this and there's no user code that executes between. The general API that prevents this from mattering is that you can't call setState in the constructor. --- packages/react-reconciler/src/ReactFiberClassComponent.new.js | 1 - packages/react-reconciler/src/ReactFiberClassComponent.old.js | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberClassComponent.new.js b/packages/react-reconciler/src/ReactFiberClassComponent.new.js index 127f6e694786a..44b9db7aacb27 100644 --- a/packages/react-reconciler/src/ReactFiberClassComponent.new.js +++ b/packages/react-reconciler/src/ReactFiberClassComponent.new.js @@ -885,7 +885,6 @@ function mountClassInstance( } } - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; const getDerivedStateFromProps = ctor.getDerivedStateFromProps; diff --git a/packages/react-reconciler/src/ReactFiberClassComponent.old.js b/packages/react-reconciler/src/ReactFiberClassComponent.old.js index 8e92d0d844074..ab2bb43796781 100644 --- a/packages/react-reconciler/src/ReactFiberClassComponent.old.js +++ b/packages/react-reconciler/src/ReactFiberClassComponent.old.js @@ -885,7 +885,6 @@ function mountClassInstance( } } - processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; const getDerivedStateFromProps = ctor.getDerivedStateFromProps;