Skip to content

fix: add getItemLayout to FlatLists for virtualization performance - #691

Merged
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
oluwaseyi1996-netizen:fix/getItemLayout-flatlists
Jun 26, 2026
Merged

fix: add getItemLayout to FlatLists for virtualization performance#691
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
oluwaseyi1996-netizen:fix/getItemLayout-flatlists

Conversation

@oluwaseyi1996-netizen

Copy link
Copy Markdown
Contributor

Summary

Adds getItemLayout prop with estimated item heights to all FlatLists in the project that were missing it, enabling proper windowed virtualization.

Changes

File List Type Item Height
MobileSearch.tsx Course search results 120px
ConnectionManager.tsx Social connections 65px
DownloadQueue.tsx Download tasks 80px
AdvancedDataGrid.tsx Data rows 40px

Why

Without getItemLayout, React Native FlatList cannot use windowed virtualization and must measure every item to determine scroll offsets. This breaks performance for large datasets.

With getItemLayout, FlatList calculates exact offsets by index, enabling efficient rendering of only visible items and smooth scrolling with large datasets.

Testing

  • Pre-existing test failures (Sentry config issue) are unrelated to these changes
  • 501 of 502 tests pass

Closes #608

Adds getItemLayout prop with estimated item heights to all FlatLists
in the project that were missing it, enabling proper windowed virtualization:

- MobileSearch.tsx (course search results): 120px item height
- ConnectionManager.tsx (connections): 65px item height
- DownloadQueue.tsx (download tasks): 80px item height
- AdvancedDataGrid.tsx (data rows): 40px item height

Without getItemLayout, FlatList cannot use windowed virtualization
and must measure every item to determine scroll offsets, which
breaks performance for large datasets.
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@oluwaseyi1996-netizen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

- Add KeyboardAvoidingView mock with displayName to jest.setup.js
- Add @sentry/react-native mock to jest.setup.js
- Fix secureStorage test mocks to properly handle read-write verification cycle
- Fix logging test expectation to match actual log signature
- Fix beforeEach blocks to use resetAllMocks for clean mock state
@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project

@RUKAYAT-CODER
RUKAYAT-CODER merged commit bd4379a into rinafcode:main Jun 26, 2026
3 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Performance] No getItemLayout on notification and course FlatLists — virtualization disabled

2 participants