From d26db282c668360a0dd09bf80593360d364268c2 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Wed, 2 Aug 2023 19:31:39 +0200 Subject: [PATCH] Fix the dropped update edge case in `@theatre/react` Before this, there was a delay between when a queued microtask is finished, and it being marked as so. If an update was queued in between this delay, it would have been missed. This wasn't caught until now, because usually in a large react tree, usually there are one or more tickers that flush the queue, so if an update isn't picked up on one flush, it would end up in the next flush. --- packages/react/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index e1a881f..826448c 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -240,9 +240,9 @@ function queueIfNeeded() { item.runUpdate() } } - }, 1) - microtaskIsQueued = false + microtaskIsQueued = false + }, 1) }) } /**