fix: resolve ImageBlock render loop caused by useResponsiveContainer oscillation - #279
Merged
Merged
Conversation
…l safe on useResponsiveContainer and fixing style of the image block to fix height made the render loop stop on react renderer
|
@ankit-thesys is attempting to deploy a commit to the thesys-devs Team on Vercel. A member of the Team first needs to authorize it. |
i-subham23
approved these changes
Mar 9, 2026
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.
Summary
useResponsiveContainerhook caused an infinite render loop because the wrapper had no stable width in non-mobile mode — it shrank to content (~48px), triggeringbreakpoint: "mobile"which appliedwidth: 100%(~900px), flipping back to"desktop", and repeating endlessly.useResponsiveContainer:setSizenow uses a functional updater that returns the previous state when width/height haven't changed, preventing unnecessary re-renders for all consumers of the hook.flex: 1 1 0; min-width: 0;andmax-width: 100%on the image, so the wrapper fills its parent consistently without depending on breakpoint state.Test plan
/chatuseResponsiveContainerare unaffectedMade with Cursor