Animated collapsible component for React Native, good for accordions, toggles etc
MIT License
2.43k
stars
453
forks
source link
Best way to implement a high-performing "collapsible section list" - OR Is there a way to avoid rendering content when the accordion is collapsed? #333
I'm trying to create a "collapsible section list", using Accordion and FlatList. Basically an Accordion where each section of data is rendered as a FlatList:
Accordion
- FlatList
- FlatList
- FlatList
However when there are hundreds of items, I start to notice performance degradation
My attempted solution is to avoid rendering the section that are collapsed. Using the isActive flag inside renderContent:
However I notice that the content is hidden before the animation starts. Is there any way to hide the content after the animation ends, and conversely, render the content before the animation starts?
I'm trying to create a "collapsible section list", using
Accordion
andFlatList
. Basically anAccordion
where each section of data is rendered as aFlatList
:However when there are hundreds of items, I start to notice performance degradation
My attempted solution is to avoid rendering the section that are collapsed. Using the
isActive
flag insiderenderContent
:However I notice that the content is hidden before the animation starts. Is there any way to hide the content after the animation ends, and conversely, render the content before the animation starts?
Thank you.