Skip to content

Commit

Permalink
issue facebook#18943 - SectionSeparatorComponent and ItemSeparatorCom…
Browse files Browse the repository at this point in the history
…ponent should displays in correct place with inverted list
  • Loading branch information
dy93 committed Oct 21, 2019
1 parent 9ce3588 commit 62f649a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Libraries/Lists/VirtualizedSectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ class VirtualizedSectionList<
section={info.section}
trailingItem={info.trailingItem}
trailingSection={info.trailingSection}
inverted={!!this.props.inverted}
/>
);
}
Expand Down Expand Up @@ -434,6 +435,7 @@ type ItemWithSeparatorProps = $ReadOnly<{|
onUpdateSeparator: (cellKey: string, newProps: Object) => void,
prevCellKey?: ?string,
renderItem: Function,
inverted: boolean,
|}>;

type ItemWithSeparatorState = {
Expand Down Expand Up @@ -533,6 +535,7 @@ class ItemWithSeparator extends React.Component<
item,
index,
section,
inverted,
} = this.props;
const element = this.props.renderItem({
item,
Expand All @@ -551,9 +554,9 @@ class ItemWithSeparator extends React.Component<
* error found when Flow v0.89 was deployed. To see the error, delete
* this comment and run Flow. */
<View>
{leadingSeparator}
{element}
{separator}
{!inverted
? [leadingSeparator, element, separator]
: [separator, element, leadingSeparator]}
</View>
) : (
element
Expand Down

0 comments on commit 62f649a

Please sign in to comment.