Samson Maben
Samson Maben

Reputation: 320

SectionList React-Native

As the natural property of sectionList Renders Header and a list of items in Heterogenous Listing: Eg:

<SectionList
  sections={[ // heterogeneous rendering between sections
    {data: [...], renderItem: ...},
    {data: [...], renderItem: ...},
    {data: [...], renderItem: ...},
  ]}
/>

How do i render SubHeaders Below Main Header and List the items of SubHeader as well as the MainHeader?

Upvotes: 0

Views: 497

Answers (1)

Mertcan Diken
Mertcan Diken

Reputation: 15361

You can use ListHeaderComponent prop for your main header. And you can use renderSectionHeader for your sections. And also just keep in mind if you don't want a sticky header stickySectionHeadersEnabled={false}.

https://facebook.github.io/react-native/docs/sectionlist.html#listheadercomponent

https://facebook.github.io/react-native/docs/sectionlist.html#rendersectionheader

https://facebook.github.io/react-native/docs/sectionlist.html#stickysectionheadersenabled

Hope this will solve your problems.

Upvotes: 1

Related Questions