ChannelListMessenger
Component to render list of channels, within the ChannelList
component.
This is the default component provided to the prop List
on the ChannelList
component.
Props
overrides the value from ChannelsContext additionalFlatListProps
Additional props provided to the underlying FlatList.
Example
const flatListProps = { bounces: true };
<ChannelList additionalFlatListProps={flatListProps} />;
Don't use additionalFlatListProps
to access the FlatList ref, use setFlatListRef
instead.
Type |
---|
object |
overrides the value from ChannelsContext channels
Array of channels currently loaded within the ChannelList
component.
Type |
---|
array |
overrides the value from ChannelsContext error
True if a call to query channels API call within ChannelList
component results in error, either during first load or during pagination.
Type |
---|
boolean |
overrides the value from ChannelsContext loadingChannels
True if ChannelList
component is loading the first page of channels.
Type |
---|
boolean |
overrides the value from ChannelsContext loadingNextPage
True if ChannelList
component is loading more channels as part of pagination. This will be set to true when user scrolls to bottom of the list and hasNextPage
is true.
Type |
---|
boolean |
overrides the value from ChannelsContext loadMoreThreshold
Sets the onEndReachedThreshold
of the underlying FlatList.
Type | Default |
---|---|
number | 2 |
overrides the value from ChannelsContext loadNextPage
Function to load next page for the ChannelList
component.
Type |
---|
function |
overrides the value from ChannelsContext refreshing
True if ChannelList
component is refreshing the list (using refreshList
function call). Refreshing state will be triggered either when user executes pull-to-refresh gesture or if network connection is being recovered.
This value is attached to refreshing prop of underlying FlatList
component of ChannelList
.
Type |
---|
boolean |
overrides the value from ChannelsContext refreshList
Function to manually re-sync or refresh the channels in ChannelList
component.
Calling refreshList
will trigger a RefreshControl on underlying FlatList component.
Type |
---|
function |
overrides the value from ChannelsContext reloadList
Function to manually reload the channels in ChannelList
component.
Calling reloadList
will wipe out the existing list of channels and show a loading indicator until new results are ready.
Type |
---|
function |
overrides the value from ChannelsContext setFlatListRef
Callback function to access the underlying FlatList ref.
Example
const flatListRef = useRef();
<ChannelList setFlatListRef={ref => (flatListRef.current = ref)} />;
Type |
---|
function |
Parameter | Description |
---|---|
ref | FlatList ref |
overrides the value from ChannelsContext EmptyStateIndicator
Rendered when the channel list is empty and not loading via the ListEmptyComponent prop on the FlatList.
Type | Default |
---|---|
component | EmptyStateIndicator |
overrides the value from ChannelsContext FooterLoadingIndicator
Rendered when loadingNextPage
from ChannelsContext
is true via the ListFooterComponent
prop on the FlatList.
Type | Default |
---|---|
component | ChannelListFooterLoadingIndicator |
overrides the value from ChannelsContext ListHeaderComponent
Rendered when provided if the channel list is not empty via the ListHeaderComponent
prop on the FlatList.
Type |
---|
component |
overrides the value from ChannelsContext LoadingErrorIndicator
Rendered when error
from ChannelsContext
is true, and the channel list is empty and not loading.
Type | Default |
---|---|
component | LoadingErrorIndicator |
overrides the value from ChannelsContext LoadingIndicator
Rendered when the channel list is empty and loading via the ListEmptyComponent prop on the FlatList.
Type | Default |
---|---|
component | ChannelListLoadingIndicator |