Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
Base implementation for the more convenient and components, which are also better documented. In general, this should only really be used if you need more flexibility than FlatList provides, e.g. for use with immutable data instead of plain arrays. Virtualization massively improves memory consumption and performance of large lists by maintaining a finite render window of active items and replacing all items outside of the render window with appropriately sized blank space. The window adapts to scrolling behavior, and items are rendered incrementally with low-pri (after any running interactions) if they are far from the visible area, or with hi-pri otherwise to minimize the potential of seeing blank space.

Example


Some caveats:
  • Internal state is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item data or external stores like Flux, Redux, or Relay.
  • This is a PureComponent which means that it will not re-render if props are shallow-equal. Make sure that everything your renderItem function depends on is passed as a prop (e.g. extraData) that is not === after updates, otherwise your UI may not update on changes. This includes the data prop and parent component state.
  • In order to constrain memory and enable smooth scrolling, content is rendered asynchronously offscreen. This means it’s possible to scroll faster than the fill rate and momentarily see blank content. This is a tradeoff that can be adjusted to suit the needs of each application, and we are working on improving it behind the scenes.
  • By default, the list looks for a key prop on each item and uses that for the React key. Alternatively, you can provide a custom keyExtractor prop.

Reference

Props

ScrollView props

Inherits ScrollView Props.

data

Opaque data type passed to getItem and getItemCount to retrieve items.

getItem Required

A generic accessor for extracting an item from any sort of data blob.

getItemCount Required

Determines how many items are in the data blob.

renderItem Required

Takes an item from data and renders it into the list

ItemSeparatorComponent

Rendered in between each item, but not at the top or bottom. By default, highlighted and leadingItem props are provided. renderItem provides separators.highlight/unhighlight which will update the highlighted prop, but you can also add custom props with separators.updateProps. Can be a React Component (e.g. SomeComponent), or a React element (e.g. ).

ListItemComponent

Each data item is rendered using this element. Can be a React Component Class, or a render function.

ListFooterComponent

Rendered at the bottom of all the items. Can be a React Component (e.g. SomeComponent), or a React element (e.g. ).

ListFooterComponentStyle

Styling for internal View for ListFooterComponent.

ListHeaderComponent

Rendered at the top of all the items. Can be a React Component (e.g. SomeComponent), or a React element (e.g. ).

ListHeaderComponentStyle

Styling for internal View for ListHeaderComponent.

debug

debug will turn on extra logging and visual overlays to aid with debugging both usage and implementation, but with a significant perf hit.

getItemLayout


horizontal

If true, renders items next to each other horizontally instead of stacked vertically.

initialNumToRender

How many items to render in the initial batch. This should be enough to fill the screen but not much more. Note these items will never be unmounted as part of the windowed rendering in order to improve perceived performance of scroll-to-top actions.

initialScrollIndex

Instead of starting at the top with the first item, start at initialScrollIndex. This disables the “scroll to top” optimization that keeps the first initialNumToRender items always rendered and immediately renders the items starting at this initial index. Requires getItemLayout to be implemented.

keyExtractor

Used to extract a unique key for a given item at the specified index. Key is used for caching and as the react key to track item re-ordering. The default extractor checks item.key, then item.id, and then falls back to using the index, like React does.

onEndReached

Called once when the scroll position gets within onEndReachedThreshold from the logical end of the list.

onEndReachedThreshold

How far from the end (in units of visible length of the list) the trailing edge of the list must be from the end of the content to trigger the onEndReached callback. Thus, a value of 0.5 will trigger onEndReached when the end of the content is within half the visible length of the list.

onStartReached

Called once when the scroll position gets within within onStartReachedThreshold from the logical start of the list.

onStartReachedThreshold

How far from the start (in units of visible length of the list) the leading edge of the list must be from the start of the content to trigger the onStartReached callback. Thus, a value of 0.5 will trigger onStartReached when the start of the content is within half the visible length of the list.

onViewableItemsChanged

Called when the viewability of rows changes, as defined by the viewabilityConfig prop.

progressViewOffset

Set this when offset is needed for the loading indicator to show correctly.

viewabilityConfig

See ViewabilityHelper.js for flow type and further documentation.

viewabilityConfigCallbackPairs

List of ViewabilityConfig/onViewableItemsChanged pairs. A specific onViewableItemsChanged will be called when its corresponding ViewabilityConfig’s conditions are met. See ViewabilityHelper.js for flow type and further documentation.

scrollToEnd()

Scrolls to the end of the content. May be janky without getItemLayout prop. Parameters: Valid params keys are:
  • 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to true.

scrollToIndex()

Valid params consist of:
  • index (number). Required.
  • animated (boolean). Optional.
  • viewOffset (number). Optional.
  • viewPosition (number). Optional.

scrollToOffset()

Scroll to a specific content pixel offset in the list. Param offset expects the offset to scroll to. In case of horizontal is true, the offset is the x-value, in any other case the offset is the y-value. Param animated (true by default) defines whether the list should do an animation while scrolling.
Last modified on September 30, 2025