mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user