mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Patch loophole that caused some Animated instructions to be executed out of order
Summary: This patches a loophole in the logic that caused some operations to execute immediately and some to be deferred, even within the same render loop. This caused the non-queued operations to be executed out of order. Instead, if an operation is created and a queued exists, we just push the operation to the end of the queue so ordering is preserved. Changelog: [Internal] Reviewed By: javache Differential Revision: D36379125 fbshipit-source-id: d9f63f4d47d8453d51add61763b7b9c74ffe9d88
This commit is contained in:
committed by
Facebook GitHub Bot
parent
12f6081865
commit
bd2d0b28bd
@@ -78,7 +78,10 @@ const API = {
|
||||
}
|
||||
},
|
||||
queueOperation: (fn: () => void): void => {
|
||||
if (queueOperations) {
|
||||
// If queueing is explicitly on, *or* the queue has not yet
|
||||
// been flushed, use the queue. This is to prevent operations
|
||||
// from being executed out of order.
|
||||
if (queueOperations || queue.length !== 0) {
|
||||
queue.push(fn);
|
||||
} else {
|
||||
fn();
|
||||
|
||||
Reference in New Issue
Block a user