From bc30ef9842a5c2719828278aa8aa2e4df9575cda Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Thu, 9 Mar 2017 15:55:07 -0800 Subject: [PATCH] Work around loose typing for fiber.updateQueue The updateQueue field is currently an any type. Check the fiber's tag so that only UpdateQueues are passed to getPendingPriority. --- src/renderers/shared/fiber/ReactFiberScheduler.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderers/shared/fiber/ReactFiberScheduler.js b/src/renderers/shared/fiber/ReactFiberScheduler.js index 290efb7cab..29b74134ec 100644 --- a/src/renderers/shared/fiber/ReactFiberScheduler.js +++ b/src/renderers/shared/fiber/ReactFiberScheduler.js @@ -571,7 +571,13 @@ module.exports = function( // Check for pending update priority. This is usually null so it shouldn't // be a perf issue. const queue = workInProgress.updateQueue; - if (queue !== null) { + const tag = workInProgress.tag; + if ( + queue !== null && + // TODO: Revisit once updateQueue is typed properly to distinguish between + // update payloads for host components and update queues for composites + (tag === ClassComponent || tag === HostRoot) + ) { newPriority = getPendingPriority(queue); }