Closed hirbod closed 4 years ago
Maybe like so
function separatorPropsEqual() {
return true;
}
const renderSeparator = React.memo(
() => <View style={{ width: SEPARATOR_SIZE }} />,
separatorPropsEqual,
);
hi @Hirbod , i'll work on it this weekend
Maybe the separator should also be overwritable? And I am still feeling like decelerationRate should also be overwritable.
@Hirbod have you tried to optimising the flatlist with windowSize
& maxToRenderPerBatch
?
@gorhom yes, but after diggin through a lot of posts I found out that also separator should be a Pure/Memoized Component
okay, i can see the importance of this, i'll push it with the next release 👍
Thanks. You could actually copy over my snippet (and format to your needs). Its working fine. Still thinking if passing own separator is important or not but I don't think that it should be, since the size is adjustable
hmm i'll investigate it more, however for having a memoized separator, you could submit a pr :)
Sure.
PR sent #9
thanks , i'll review it now :)
I think the equal function check should be moved outside of the functional component
https://github.com/gorhom/react-native-sticky-item/blob/master/src/StickyItemFlatList.tsx#L194
Since it should be a „Pure Component“. I would also think that the second parameter for „arePropsEqual“ could always return true in this case.
After I memoized this I could finally get rid of this VirtualizedList is large and slow to update message.
@gorhom