Skip to main content
React Native provides specialized components for rendering lists of data efficiently. Unlike using map() with ScrollView, these components only render items currently visible on screen.

FlatList vs ScrollView

FlatList

Lazy-loads items as you scroll. Best for large datasets. Only renders visible items.

ScrollView

Renders all children at once. Good for small, static lists. Simple but not performant for large lists.
Don’t use ScrollView with map() for large lists. Use FlatList instead to avoid performance issues.

Basic FlatList

The FlatList component requires two props: data and renderItem.
FlatList Example

FlatList Props

Essential Props

Array
required
The array of items to render
Function
required
Function that returns JSX for each item. Receives {item, index, separators} as argument.
Function
Function that returns a unique key for each item. Default uses item.key or falls back to index.

From React Native Source

From Libraries/Lists/FlatList.js:
FlatList.js (source)

Real-World Example

A contact list with touchable items:
Contact List

Performance Optimization

getItemLayout

If your items have fixed height, provide getItemLayout for better performance:
From the React Native source: “getItemLayout is an optional optimization that lets us skip measurement of dynamic content if you know the height of items a priori.”

initialNumToRender

Control how many items render initially:

Headers, Footers, and Empty States

Pull to Refresh

SectionList

For lists with section headers, use SectionList:
SectionList Example

SectionList from Source

From Libraries/Lists/SectionList.js:
SectionList.js (source)

Horizontal Lists

Multiple Columns

Infinite Scroll

Best Practices

Keys help React identify which items have changed, are added, or removed. Never use array index as key for dynamic lists.
Prevent unnecessary re-renders of list items when parent updates.
This skips measurement and improves scroll performance significantly.
Unmount components that are off screen to reduce memory usage.
Use appropriate image sizes and consider using FastImage for better performance.

Next Steps

Networking

Learn to fetch data for your lists from APIs

Platform-Specific Code

Handle list behavior differences between iOS and Android