fix: eliminate home screen lag via memoization and FlashList migration - #16
Draft
prince-d-simform with Copilot wants to merge 3 commits into
Draft
fix: eliminate home screen lag via memoization and FlashList migration#16prince-d-simform with Copilot wants to merge 3 commits into
prince-d-simform with Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/prince-d-simform/AI-spec/sessions/d50f284e-f7c1-4c37-b1fb-1e6e9bee53ef Co-authored-by: prince-d-simform <104822674+prince-d-simform@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix lagging issue on home screen
fix: eliminate home screen lag via memoization and FlatList tuning
Apr 2, 2026
prince-d-simform
left a comment
Owner
There was a problem hiding this comment.
@copilot can you please use the Flashlist instead of flatlist
There was a problem hiding this comment.
Pull request overview
This PR targets Home screen performance by reducing unnecessary re-renders and layout work in the product grid, primarily by stabilizing prop references passed to FlatList and tuning initial/batch rendering behavior.
Changes:
- Memoizes
productFeedbackevaluation so the feedback element is only recomputed when the underlying render callbacks change. - Stabilizes
FlatListcontentContainerStyleandcolumnWrapperStylereferences viauseMemoto avoid triggering redundant work each render. - Tunes
FlatListrendering withinitialNumToRender={6}andmaxToRenderPerBatch={4}to reduce initial and scroll-time JS thread pressure.
Agent-Logs-Url: https://github.com/prince-d-simform/AI-spec/sessions/cf2a3ba1-5ef2-4263-8d9e-c74de5fd6985 Co-authored-by: prince-d-simform <104822674+prince-d-simform@users.noreply.github.com>
Author
Done in f543424. Replaced Key changes:
|
Copilot
AI
changed the title
fix: eliminate home screen lag via memoization and FlatList tuning
fix: eliminate home screen lag via memoization and FlashList migration
Apr 3, 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.
The home screen was lagging due to unnecessary re-renders driven by unstable prop references and React Native's default
FlatListrendering overhead.Root causes & fixes
contentContainerStylenew array reference every render — stabilized withuseMemoso FlashList receives a stable reference.productFeedbackcalling 4 render functions unconditionally — now wrapped inuseMemo, only re-evaluated when the underlyinguseCallbackreferences change.FlatListwithFlashList— migrated the product grid to@shopify/flash-listfor significantly better scroll performance via its internal recycling architecture.FlashList migration
estimatedItemSizescale(300)— device-adaptive ProductCard height estimatecolumnWrapperStyleremoveClippedSubviews,windowSize,maxToRenderPerBatch,initialNumToRenderestimatedItemSizeuses the project'sscale()utility so the estimate adapts to the current device's screen dimensions.