FlashList v2 is a ground-up rewrite for the New Architecture
Shopify has published the technical details behind FlashList v2, a complete rewrite of its list component for React Native's New Architecture. In a post by Talha Naqvi, the team says v2 already powers thousands of lists in the Shopify mobile app and is now ready for production use. FlashList, first released in 2022 as a drop-in replacement for FlatList, has passed 2 million monthly downloads.
Why a rewrite
According to the post, v1 had several limitations:
- Developers had to supply
estimatedItemSizeor per-item estimates viaoverrideItemLayout. - Native modules on Android and iOS corrected layout gaps and overlaps, and sometimes conflicted with layout animations.
- Scrolling to specific items or keeping scroll position during updates was not always accurate.
- Horizontal list items could not change height after the initial mount.
No more estimates
The New Architecture's synchronous layout measurements let FlashList measure items and apply corrections inside a useLayoutEffect, where a state update blocks paint. The approach rests on three pieces: progressive rendering (mounting only one or two items at first, then more once sizes are known), predictions for unmeasured items based on items of the same type, and corrections applied in a loop before the next paint. This let the team remove all native code, including components like AutoLayoutView.
Scrolling and horizontal lists
When scrollToIndex is called, v2 computes the target from its layout map, measures neighbouring items, refines the target as items are measured and then scrolls, landing on the target item. Horizontal list items can now be any size and resizable, with the list's height adjusting automatically. A horizontal list nested in a vertical FlashList tells its parent to wait for its layout before rendering.
Rendering and data changes
Instead of v1's fixed render window, v2 uses an adaptive algorithm that factors in scroll velocity, direction and device performance. Shopify reports up to 50% less blank area while scrolling on the New Architecture compared to v1 in its benchmarks. Item reuse has also been reworked to minimize renders and allow layout animations; a separate guide for setting those up with Reanimated is planned.
Other changes
- Better web support, since v2 no longer relies on native components.
- A new
maintainVisibleContentPositionprop, enabled by default, keeps scroll position stable when content changes or items resize while scrolling up. - Masonry is now a prop on FlashList and supports
overrideItemLayout, allowing varying column spans. - A
maxItemsInRecyclePoolprop caps the size of the recycle pool. - New helper hooks for layout updates, syncing item state and accessing the parent list's ref.
The post describes the upgrade path as straightforward, noting that FlashList v2 "is ready for production today."
Links
Source: shopify.engineering