Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

653
Views
ScrollViews and FlatList doesn't work together

I receive this error in my app:

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.

I have and index.js

<ScrollView style={styles.container} showsVerticalScrollIndicator={false}>
   //...
{selected === 1 && <Component1 />}
{ selected === 2 && <Component2 />}
  </ScrollView>

Now inside my Component2 I have

<View>
 //....
<CustomFlatList data={dataPermission()}
</View>

I use this dataPermission to popolute "data"

and at the end in my CustomFlatList I use the FlatList

const renderItem = () => {
<TouchableOpacity style={[styles.row]}>
  //....
</TouchableOpacity>
 }


if (data.length == 0) {
    return (
      <View style={styles.container}>
        //....
      </View>
    )
  } else {
    return (
      <View style={styles.container}>
        <FlatList data={data} renderItem={renderItem} />
      </View>
    )
  }

Now my problem is that I have used in the index.js a ScrollView with inside a FlatList and I suppose that is the problem.

In your opinion how can I do to fix this error?

Thank you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The error message is straight forward: You should never nest a FlatList inside a ScrollView. This is because the parent scroll action dominates the child scroll action.

This problem is easy to resolve. Replace the parent ScrollView with a normal View. The FlatList already supports scrolling. If you have multiple sections (i.e. different data sets), then you might want to use a SectionList.

Remark: You can usually achieve visually the same with a ScrollView as you could do with a FlatList BUT

ScrollView renders all its react child components at once, but this has a performance downside.

Thus, it is advised to use a FlatList whenever one want to render data inside a scrollable container.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!