React Native & Expo errors · Error 09 of 12

“VirtualizedLists should never be nested inside plain ScrollViews”

By Muhammad Abdullah, full-stack, mobile and ai automation developer · Last reviewed

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation

Short answer

A FlatList or SectionList is inside a ScrollView that scrolls the same way, which breaks list virtualization and performance. Remove the outer ScrollView and put the extra content in the list’s header or footer.

Common causes

  • Wrapping a whole screen in a ScrollView that also contains a FlatList.

How to fix it

  1. Render the surrounding content through the list itself:

                          <FlatList
      data={items}
      renderItem={renderItem}
      ListHeaderComponent={<ProfileHeader />}
      ListFooterComponent={<Footer />}
    />
                        
  2. For several groups of rows, use one SectionList instead of several FlatLists.

Let’s talk about the next step

Have an idea, a stuck app, or a workflow toimprove?

Tell me what you are building, what is blocking you, and what a successful outcome looks like.