Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display in scrollview or support for Header and Footer component just like regular Flatlist #35

Open
lekeCoder opened this issue Nov 27, 2020 · 1 comment

Comments

@lekeCoder
Copy link

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
Copy link

andrei-zgirvaci commented Mar 25, 2021

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 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants