Skip to main content

SectionListWrapper

Content

Wrapper around SectionList which operates based on provided LoadState and shows appropriate data.

Params

Extends SectionListProps and additionally adds next properties

NameTypeRequiredDefault valueDescription
loadStateLoadStateTrue-Load state
tryAgain() => voidFalseUndefinedAction callback which occurs when pressing on Try Again
errorstring or nullFalselocalization.errors.listErrorTitleError text which will be shown to user in case if loadState == LoadState.error

Usage example

  return (
<SectionListWrapper
stickySectionHeadersEnabled={true}
sections={sections}
ListHeaderComponent={<BalanceListHeader balance={balance} />}
loadState={loadState}
renderItem={renderItem}
renderSectionHeader={renderSectionHeader}
error={error}
tryAgain={tryAgain}
onRefresh={pullToRefresh}
onEndReached={loadMore}
ListEmptyComponent={<EmptyView title={localization.empty.payment} description={localization.empty.paymentDescription} />}
/>
);