From 5dbe02c9cffcee699a6ccc05e5204f355bfd5e84 Mon Sep 17 00:00:00 2001 From: Ricky Hanlon Date: Mon, 25 Mar 2024 14:16:05 -0400 Subject: [PATCH] Fix gating for alwaysThrottleDisappearingFallbacks --- .../src/__tests__/ReactSuspenseWithNoopRenderer-test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js index f52c33887c257..9c32a588b5454 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js @@ -1846,7 +1846,14 @@ describe('ReactSuspenseWithNoopRenderer', () => { await resolveText('B'); await waitForPaint(['B']); - if (gate(flags => flags.alwaysThrottleRetries)) { + if ( + // This behavior only applies if both flags are enabled. + gate( + flags => + flags.alwaysThrottleDisappearingFallbacks && + flags.alwaysThrottleRetries, + ) + ) { // B should not commit yet. Even though it's been a long time since its // fallback was shown, it hasn't been long since A appeared. So B's // appearance is throttled to reduce jank.