Essential Performance Props
Draw distance for advanced rendering (in dp/px). This controls how much content is rendered outside the visible viewport.Higher values mean more items are pre-rendered, reducing blank space during fast scrolling but using more memory.
Only adjust this if you’re experiencing blank space during fast scrolling. The default value works well for most use cases.
Item Layout Optimization
overrideItemLayout
(layout: { span?: number }, item: TItem, index: number, maxColumns: number, extraData?: any) => void
This method can be used to change column span of an item. Changing item span is useful when you have grid layouts (Parameters:
numColumns > 1) and you want few items to be bigger than the rest.Modify the given layout object. Do not return a value. FlashList will fallback to default values if this is ignored.layout: Object withspanproperty to modifyitem: The data itemindex: Index in the data arraymaxColumns: Total number of columns (value ofnumColumnsprop)extraData: Value fromextraDataprop
Recycling Configuration
Maximum number of items in the recycle pool. These are the items that are cached in the recycle pool when they are scrolled off the screen.Unless you have a huge number of item types, you shouldn’t need to set this. Setting this to 0 will disable the recycle pool and items will unmount once they are scrolled off the screen.There’s no limit by default.When to adjust:
- Set to
0if items have expensive cleanup (e.g., timers, subscriptions) - Increase if you have many item types and notice unmount/remount overhead
- Keep default for most use cases
Render Optimization
Allows developers to override type of items. This will improve recycling if you have different types of items in the list. The right type will be used for the right item. Default type is 0.If you don’t want to change type for certain indexes, just return undefined.Benefits:
- Better recycling: Headers recycle headers, posts recycle posts, etc.
- Prevents layout thrashing when item types have different sizes
- More efficient memory usage
- Return a simple string or number
- Avoid complex calculations
- Don’t create new objects/arrays
- Use a property from the item if possible
When true, offscreen child views are removed from the native view hierarchy. This can improve scrolling performance on long lists. Inherited from ScrollView.
This is generally not needed with FlashList as it already handles view recycling efficiently.
Performance Monitoring
This event is raised once the list has drawn items on the screen. It reports
elapsedTimeInMs which is the time it took to draw the items.This is required because FlashList doesn’t render items in the first cycle. Items are drawn after it measures itself at the end of first render.If you’re using
ListEmptyComponent, this event is raised as soon as ListEmptyComponent is rendered.Advanced Configuration
Allows overriding internal ScrollView props. Props provided here are spread onto the internal ScrollView after all other props, so they take highest priority.OverrideProps Type:
Performance Best Practices
1. Use getItemType for Mixed Content
2. Optimize renderItem
3. Use extraData Properly
4. Key Extraction
5. Avoid Expensive Operations in Render Callbacks
Debugging Performance Issues
Blank Space During Scrolling
Cause:drawDistance is too low.
Solution:
Scroll Lag
Cause: HeavyrenderItem or too many item types without getItemType.
Solution: