fix: defer setOrder to avoid render-phase state update warning - #630
Merged
Conversation
OrderContainer invokes the fetchOrder callback during render, so updating AppProvider state synchronously triggers React's "cannot update a component while rendering a different component" warning. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Playwright can't auto-scroll the outer page for elements inside the cross-origin Stripe iframe, so scroll manually only when the tab is below the fold instead of always wheeling by a fixed amount.
marco-commercelayer
approved these changes
Jul 8, 2026
Contributor
|
🎉 This PR is included in version 6.5.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AppProvider.getOrder:OrderContainer(from@commercelayer/react-components) invokes thegetOrdercallback during render, so callingsetOrdersynchronously triggered React's "Cannot update a component while rendering a different component" warning. The state update is now deferred withsetTimeout(..., 0);orderRefis still set synchronously so consumers reading the ref are unaffected.CheckoutPage.ts(e2e fixture): replaced the fixedmouse.wheel(0, 300)scroll with a conditional one — the Stripe payment tab lives in a cross-origin iframe, so Playwright can't auto-scroll the outer page for it. The fixture now measures the tab's bounding box and scrolls only when it's below the fold, just enough to bring it into view.Why
The render-phase
setStatewarning polluted the console on every order load and can mask real issues. The blind 300px scroll made the Stripe tab click flaky depending on viewport size and page layout.🤖 Generated with Claude Code