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.
This commit is contained in:
Andrew Clark
2017-03-15 15:05:04 -07:00
parent 21e0e3711b
commit bc30ef9842
@@ -571,7 +571,13 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
// 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);
}