Skip to content

Conversation

@pythonsst
Copy link

Description

Fixes #2013

Ensures layout convergence when modifyChildrenLayout repeatedly invalidates layout without reaching a commit.

In rare timing-dependent scenarios (e.g. variable item measurements, anchoring, concurrent layout effects), layout could continuously change by small amounts, causing repeated setRenderId calls inside a layout effect and preventing commitLayout from ever executing. This resulted in unnecessary re-renders and the “Exceeded max renders without commit” warning.

This change bounds layout retries and forces a commit after a small number of attempts, guaranteeing forward progress while leaving stable layout behavior unchanged.

Affected package(s):

@shopify/flash-list


Reviewers’ hat-rack 🎩

Verify the bounded retry logic in the layout effect

Confirm commitLayout is guaranteed without impacting stable cases

Confirm no changes to scroll-driven render paths

 Prevent unbounded layout re-renders

 Guarantee layout commit

 No behavior change for stable layouts

Screenshots or videos

Not applicable (internal layout/rendering fix).

@pythonsst pythonsst changed the title Fix infinite render loop by guaranteeing layout commit Fix infinite render loop by guaranteeing layout commit. Dec 21, 2025
@pythonsst pythonsst force-pushed the fix/issue-2013-layout-loop branch from 433ab12 to 356312d Compare December 21, 2025 21:38
Refactor layout retry logic to improve readability and convergence clarity
@pythonsst pythonsst force-pushed the fix/issue-2013-layout-loop branch from ee667f1 to f86459c Compare December 21, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant