Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React Native - Flatlist with Swipelist views inside , is not Scrollable

$
0
0

Here is the FlatList component which I cannot scroll the swiplist child components. I have tried Adding ScrollView instead of FlatList but It gives me the error virtualizedlist should never be nested inside plain scrollview with the same orientation. With nesting SwipeList inside a flatlist the error is gone but I cannot scroll. Any idea what is the right way to fix this?

<View><FlatList        nestedScrollEnabled={true}        scrollEnabled={true}        keyExtractor={(item, index) => 'key'+ index}        data={data}        renderItem={({ item }) => {          return (<Component              list={item.list}              list2={item.list2}              list3={item.list3}            />           );        }}      /></View>

Inside the component. Each one of the child components(List, List2, List3) represents a swiplist view.

export const Component= ({  list,  list2,  list3,}: IComponentProps): JSX.Element => {  return (<View><Text>List</Text><List list={list} /><List2 list2={list2} /><List3 list3={list3} /></View>  );};

And finally inside the List component

<SwipeListView      data={list}      listKey={'list'}      leftOpenValue={10}      rightOpenValue={-150}      previewRowKey={'0'}      previewOpenValue={-40}      keyExtractor={listItem=> listItem.id.toString()}      previewOpenDelay={3000}      closeOnScroll={true}      closeOnRowBeginSwipe={true}      stopLeftSwipe={1}      renderItem={({ item }) => (<View><ListCard list={item}/></View>      )}    />

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>