Environment:
OS: macOS High Sierra 10.13.1
Node: 8.6.0
Yarn: 1.5.1
npm: 4.6.1
Watchman: 4.9.0
Xcode: Xcode 9.0.1 Build version 9A1004
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3
Clone this repository and run it via react-native run-ios.
Observe the section separators are in wrong (randomly?) places.
The section list headers should be in the top of the section instead of the bottom like section footers do with an inverted list (but they aren't sticky).

The section headers are footers instead of headers. They are sticky because of https://github.com/facebook/react-native/pull/17762 but still footers, not headers.
Sample code:
export default class App extends React.Component {
render() {
return (
<View style={s.container}>
<SectionList
inverted
sections={mock.sections}
maxToRenderPerBatch={10}
initialNumToRender={10}
style={{ flex: 1 }}
keyExtractor={(item) => item.messageId}
renderSectionHeader={sectionProps => (
<SectionHeader
{...sectionProps}
/>
)}
renderItem={({ item }) => (
<ListItem
item={item}
/>
)}
ItemSeparatorComponent={ItemSeparator}
/>
/>
</View>
);
}
}

try:
set sectionlist stickySectionHeadersEnabled={false}
use renderSectionFooter instead of renderSectionHeader with inverted case
@almorak thanks for your advice, but it won't fix the bug at all.
Sticky headers are common behavior for chat date headers, I still need them.
Also, see my second issue:
https://github.com/facebook/react-native/issues/18943
Hi @janicduplessis, you have worked on support of inverted sticky headers, but there are some issues, could you please look at them?
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.
Still there is no any workaround or fix for that, so it can't be closed.
Any workaround on this?
@iamolegga I just don't use section list with sticky headers currently. Just simply FlatList with custom functions for creating sections and then render it.
Also struggling with this here, I'm implementing infinite scroll to the top and need sticky headers (or inverted footers, apparently). Any solutions so far?
I've been able to use this as a workaround:
<SectionList>
renderSectionFooter={<View style={{transform: [{ scaleY: -1 }]}}>...</View>}
renderItem={<View style={{transform: [{ scaleY: -1 }]}}>...</View>}
inverted={true}
</SectionList>
Could you please provide an example with that fix applied to my repro?
Here is what I've got:

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
This hasn't been fixed yet.
just simple use renderSectionFooter then header and make inverted true simple
I'm having the same issue with inverted sticky headers.
just simple use renderSectionFooter then header and make inverted true simple
This doesn't address the issue. We're looking to have sticky section headers on inverted lists
+1
opened this issue on 19 Apr 2018
Not able to find a good solution here. What we really need is the ability to make sticky footers a possibility. Then, when a list is inverted, you can switch stickyFooters on to keep it sticky at the top and start above the content of the section.
I just checked this issue on 0.62 and seems like it's still there.
Please provide us a new param stickySectionFooterEnabled
If someone is still stuck on it, Medium has posted a workaround:
https://medium.com/@smali.kazmi/react-native-sticky-date-like-whatsapp-using-inverted-sectionlist-c141f5933d55
in which I've made some changes to make it desappear when not needed anymore:
just setting it to null when lastItem is the sectionHeader (sectionFooter)
function updateCurrentDate({ viewableItems, changed }: { viewableItems: Array<ViewToken>; changed: Array<ViewToken> }) {
if (viewableItems && viewableItems.length) {
const lastItem = viewableItems.pop()
if (lastItem && lastItem.item.title && lastItem.item.title === currentDate) setCurrentDate(null)
else if (lastItem && lastItem.section) setCurrentDate(lastItem.section.title)
else setCurrentDate(null)
}
else setCurrentDate(null)
}
also, changed the style of the date header to be absolute, so it appears over the list.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Still an issue.
If someone is still stuck on it, Medium has posted a workaround:
https://medium.com/@smali.kazmi/react-native-sticky-date-like-whatsapp-using-inverted-sectionlist-c141f5933d55in which I've made some changes to make it desappear when not needed anymore:
just setting it to null when lastItem is the sectionHeader (sectionFooter)function updateCurrentDate({ viewableItems, changed }: { viewableItems: Array<ViewToken>; changed: Array<ViewToken> }) { if (viewableItems && viewableItems.length) { const lastItem = viewableItems.pop() if (lastItem && lastItem.item.title && lastItem.item.title === currentDate) setCurrentDate(null) else if (lastItem && lastItem.section) setCurrentDate(lastItem.section.title) else setCurrentDate(null) } else setCurrentDate(null) }also, changed the style of the date header to be absolute, so it appears over the list.
yo man, this is the solution I was looking for, you're a lifesaver.
Thanks, buddy 馃憤馃徎
It is a shame that is hasn't been officially fixed yet.
There should be a new "inverted" prop to make the life of us who make "chat-like" components better. Inverted just sucks.
Most helpful comment
try:
set sectionlist stickySectionHeadersEnabled={false}
use renderSectionFooter instead of renderSectionHeader with inverted case