react-native-draggable-flatlist icon indicating copy to clipboard operation
react-native-draggable-flatlist copied to clipboard

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

Open lunajing opened this issue 3 years ago • 9 comments
trafficstars

I use NestableScrollContainer and NestableDraggableFlatList exactly as in the example, but I get the following scrollview nesting error in console:

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.

my code:

<NestableScrollContainer>
  <NestableDraggableFlatList
    scrollEnabled={false}
    data={data1}
    renderItem={renderItem}
    keyExtractor={(index) => `${index}`}
    onDragEnd={({ data }) => setData1(data)}
  />
  <NestableDraggableFlatList
    scrollEnabled={false}
    data={data2}
    renderItem={renderItem}
    keyExtractor={(index) => `${index}`}
    onDragEnd={({ data }) => setData2(data)}
  />
  <NestableDraggableFlatList
    scrollEnabled={false}
    data={data3}
    renderItem={renderItem}
    keyExtractor={(index) => `${index}`}
    onDragEnd={({ data }) => setData3(data)}
  />
</NestableScrollContainer>

Platform & Dependencies

  • react-native-draggable-flatlist version: 3.1.2
  • Platform: iOS/Android
  • React Native: 0.69
  • Reanimated version: 2.8.0
  • React Native Gesture Handler version: 2.2.1

lunajing avatar Jun 27 '22 03:06 lunajing

+1

LouisWT avatar Jun 29 '22 03:06 LouisWT

I am getting the same error

isuru102 avatar Jun 30 '22 08:06 isuru102

Has anyone paid attention to this issue?

lunajing avatar Jul 05 '22 10:07 lunajing

I'm getting the same error, but it doesn't seem to stop my app from running. Did anyone find a solution for this other than ignoring the error?

JaRoMasterDev avatar Jul 07 '22 12:07 JaRoMasterDev

yeah, you're gonna just have to ignore if you want to nest flatlists within scrollviews. The issue is that if you want flatlists-within-scrollables, virtualization will no longer work, since the list will expand to fill all available space.

computerjazz avatar Jul 09 '22 22:07 computerjazz

Is there a way to ignore that warning with LogBox?

JaRoMasterDev avatar Jul 09 '22 22:07 JaRoMasterDev

+1

inapeace0 avatar Aug 20 '22 14:08 inapeace0

try nesting the NestableScrollContainer in a view as in their example https://github.com/computerjazz/react-native-draggable-flatlist/blob/main/Example/screens/NestedScreen.tsx . it got rid of the error for me

goughjo02 avatar Sep 05 '22 20:09 goughjo02

+1

EstivenGonzalez avatar Nov 29 '22 10:11 EstivenGonzalez