Open
Description
Current behavior
It started happening after I've enabled new RN architecture on Expo 52.
const stickyHeaderIndices = filteredList
.map((item, index) => {
if (typeof item === 'string') {
return index;
} else {
return null;
}
})
.filter((item) => item !== null);
content = (
<FlashList
ListHeaderComponent={() => {
return(
<Text>ListHeaderComponent here!</Text>
);
}}
ItemSeparatorComponent={() => <DefaultListRowSeparator />}
contentContainerStyle={styles.contentContainer}
estimatedItemSize={moderateScale(60)}
getItemType={(item) => {
return typeof item === 'string' ? 'sectionHeader' : 'row';
}}
stickyHeaderIndices={stickyHeaderIndices}
data={filteredList}
renderItem={({ item, target }) => {
if (typeof item === 'string') {
return (
<Text fontFamily={'Poppins_500Medium'} style={styles.sectionHeader(target === 'StickyHeader')}>
{item}
</Text>
);
} else {
return (
<RowLink
label={item.title}
/>
);
}
}}
/>
);
If I touch the list the problem gets fixed:
Expected behavior
Do not duplicate the first sticky item on top of ListHeaderComponent.
To Reproduce
Platform:
- iOS
- Android
Environment
1.7.3