0

I am using native base, and the error is for flatlist that it contains inbuild scroll view no need to nest it into scrollView react native flatlist Image 1 code:

<Container>
    <Content>
        <View>
            ***
        </View>
        <FlatList 
            {...props}
        />
    </Content>
</Container>

Image 2 code:

<View>
    <View>
        <View>
            ***
        </View>
        <FlatList 
            {...props}
        />
    </View>
</View>

I want both parts to scroll without error, can anyone help me out with this?

2 Answers2

0

You'll need to slightly modify your structure

<View>
  <ScrollView>
    <View>
        ***
    </View>
    <FlatList 
        {...props}
    />
  </ScrollView>
</View>
Nooruddin Lakhani
  • 7,507
  • 2
  • 19
  • 39
0

The Content in nativebase is basically a scrollview.

You can make use of FlatList's `Header and Footer Component functionality. and mark content above FlatList as Header and content bellow it a footer.

const ContentAbove=()=>(
  <View>**</View>
)

//Then inside the component
-----
<Container>
    <FlatList
            ListHeaderComponent={<ContentAbove/>}
            ListFooterComponent={<ContentBelow/>}
            {...props}
        />
</Container>
Haseeb A
  • 5,356
  • 1
  • 30
  • 34