display in scrollview or support for Header and Footer component just like regular Flatlist
lekeCoder opened this issue · 1 comments
lekeCoder commented
hello,
I will like to display this component with other components in a scrollable view. I keep getting error 'VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container'
.
Can we do something like this:
<FlatList
data={this.state.myData}
renderItem={({ item }) => {
return <p>{item.name}</p>;
}}
ListHeaderComponent={getHeader}
ListFooterComponent={getFooter}
/>
andrei-zgirvaci commented
You can achieve that by passing the ListHeaderComponent
in the options
props like so:
<Timeline
//..other props
options={{
ListHeaderComponent={/*Your Header Component*/}
}}
options
prop is holding FlatList properties and you can specify here any props like header, footer, etc.
Hope this helps 😊