Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/rn-tester/js/examples/SectionList/SectionListExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ const CustomSeparatorComponent = ({highlighted, text}) => (
</View>
);

const EmptySectionList = () => (
<View style={{alignItems: 'center'}}>
<Text style={{fontSize: 20}}>This is rendered when the list is empty</Text>
</View>
);

class SectionListExample extends React.PureComponent<{...}, $FlowFixMeState> {
state:
| any
Expand Down Expand Up @@ -174,6 +180,15 @@ class SectionListExample extends React.PureComponent<{...}, $FlowFixMeState> {
renderSectionHeader={renderSectionHeader}
renderSectionFooter={renderSectionFooter}
stickySectionHeadersEnabled
initialNumToRender={10}
ListEmptyComponent={EmptySectionList}
onEndReached={() =>
Alert.alert(
'onEndReached called',
'You have reached the end of this list',
)
}
onEndReachedThreshold={0}
sections={[
{
key: 'empty section',
Expand Down