Search code examples
react-nativereact-native-flatlist

Flatlist Virtualized List Error in React Native


I have the following design implemented See design

The code for the design above is as follows See code

The error

The problem that I now have is that of a virtualized list error. I tried to take my flatlists out of the views but to no avail. I also tried to use the log box but it didn't work. My other attempt was to wrap my flatlist in a scrollview and specify the orientation but it didnt work.


Solution

  • Hey Jacob so the error is something like :

    You cant have two scrollable list one inside another with same orientation.

    So dont do

    <ScrollView>
     <ScrollView>
     </ScrollView>
    <ScrollView />
    

    But this is valid :

    <ScrollView>
         <ScrollView horizontal={true} >
         </ScrollView>
        <ScrollView />
    

    SInce one is vertical and one is horizontal

    Your solution might be using flatlist and add everything in renderItem using switchCase