I am trying to render a flatlist with a header. The header needs to be stuck at the top of the flatlist but needs to hide when the user scrolls down. When the user starts scrolling up again the header needs to be displayed. I'm able to get the header to stick using stickyHeaderIndices. However, StickyHeaderHiddenOnScroll does not seem to work at all. From what I understand, StickyHeaderComponent is used in a scrollView instead of ListHeaderComponent but that doesn't seem to render any header in the case of a flatlist.
<FlatList
data={selectedStream}
keyExtractor={keyExtractor}
extraData = {selectedGroup}
renderItem={renderItem}
stickyHeaderIndices={[0]}
stickyHeaderHiddenOnScroll={true}
ListHeaderComponent={()=> <ComponentThatNeedsToBeStuckToTop/>}
/>