Requirements
New Props
masonry
Enable masonry layout for grid-like interfaces with varying item heights. Previously available asMasonryFlashList, this is now a simple prop.
onStartReached
Called when the scroll position gets withinonStartReachedThreshold of the start of the content. Perfect for chat applications loading older messages.
maintainVisibleContentPosition
Configuration for maintaining scroll position when content changes. This is enabled by default in v2 to reduce visible glitches.maintainVisibleContentPosition properties
maintainVisibleContentPosition properties
disabled: Set to true to disable this feature (enabled by default)autoscrollToTopThreshold: Automatically scroll to maintain position when content is added at the topautoscrollToBottomThreshold: Automatically scroll to maintain position when content is added at the bottomanimateAutoScrollToBottom: Scroll with animation whenever autoscrollToBottom is triggered. Default istruestartRenderingFromBottom: If true, initial render will start from the bottom, useful for chat interfaces
style
Style for the FlashList’s parent container.maxItemsInRecyclePool
Maximum number of items in the recycle pool. These are cached items when they are scrolled off screen.optimizeItemArrangement
When enabled withmasonry layout, this will try to reduce differences in column height by modifying item order.
onCommitLayoutEffect
Called before layout is committed. Can be used to measure list and make changes before paint.stickyHeaderConfig
Advanced configuration for sticky headers with new options:stickyHeaderConfig properties
stickyHeaderConfig properties
useNativeDriver: Use native driver for animations (default:true)offset: Offset from top where sticky headers should stick (default:0)backdropComponent: Component to render behind sticky headers (e.g., blur effect)hideRelatedCell: Hide the cell when displayed as sticky header (default:false)
onChangeStickyIndex
Callback invoked when the currently displayed sticky header changes.Changed Props
overrideItemLayout
This used to allow a way to change the span of items and provide size estimates. In v2, span is supported, but we no longer read the size estimates.New Features
Masonry as a Prop
masonry is now a prop on FlashList. It’s also possible to use overrideItemLayout with masonry.
RTL Support
FlashList v2 adds full support for RTL (right-to-left) layouts.maintainVisibleContentPosition
Now enabled by default, this feature reduces visible glitches as much as possible. Chat apps without inverted mode are now possible.If you plan on adding a large number of rows on top of the list, you may want to increase the
drawDistance on the list.Major Improvements
No More Size Estimates Required
FlashList v2 doesn’t ask for any estimates, making it much easier to use. Simply remove:estimatedItemSizeestimatedListSizeestimatedFirstItemOffset
Precise Scrolling
scrollToIndex and scrollToItem are much more precise in v2.
Better Orientation Changes
Scrolling upwards after orientation change doesn’t cause layout glitches. The same is true for scrolling to items and scrolling upwards.Improved Sticky Headers
Sticky headers use an Animated implementation, so minor gaps between them while scrolling aren’t visible anymore.Enhanced Horizontal Lists
Horizontal lists are much improved, and items can also resize within the lists. We no longer render an extra item to measure list height.Grid Layout Height Matching
In grid layout, if side-by-side items have different heights, then the shorter item will match the height of the tallest item. This wasn’t possible in v1.contentContainerStyle Fully Supported
ThecontentContainerStyle prop is now fully supported.
Enhanced Ref Methods
The ref of FlashList has many more useful methods likegetVisibleIndices and getLayout.
New Hooks
useLayoutState
Similar touseState but communicates the change in state to FlashList. Useful if you want to resize a child component based on a local state.
useLayoutState example
useLayoutState example
onLayout callback in the absence of useLayoutState, which might not look as smooth on a case-by-case basis.useRecyclingState
Similar touseState but accepts a dependency array. On change of deps, the state gets reset without an additional setState call.
useRecyclingState example
useRecyclingState example
useLayoutState built in.useMappingHelper
Returns a function that helps create optimal mapping keys for items when using.map() in your render methods.
useMappingHelper example
useMappingHelper example
useFlashListContext
Exposes helpers to easily accessref of FlashList. It also exposes ref of ScrollView. Ideal for use within child components or CellRendererComponent.
New Helper Components
LayoutCommitObserver
A component that observes when FlashList commits a layout. This is particularly useful when you have one or more FlashLists somewhere down the component tree and need to know when all of them have finished their layout commit. Read more in the Layout Commit Observer guide.Deprecated Props
Size Estimation Props (No Longer Needed)
estimatedItemSize: No longer usedestimatedListSize: No longer usedestimatedFirstItemOffset: No longer used
Deprecated Features
inverted: UsemaintainVisibleContentPositioninsteadonBlankArea: No plans to add or continue supporting this propdisableHorizontalListHeightMeasurement: No longer neededdisableAutoLayout: There’s no auto layout in v2MasonryFlashList: Replaced bymasonrypropgetColumnFlex: Not supported in FlashList v2 withmasonryprop