You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`currentChannels`| The state of loaded `Channel` objects queried thus far. Has to be set with `setChannels` (see below). |
230
230
|`queryType`| A string indicating, whether the channels state has to be reset to the first page ('reload') or newly queried channels should be appended to the `currentChannels`. |
231
231
|`setChannels`| Function that allows us to set the channels state reflected in `currentChannels`. |
232
232
|`setHasNextPage`| Flag indicating whether there are more items to be loaded from the API. Should be infered from the comparison of the query result length and the query options limit. |
233
233
234
234
The function has to:
235
+
235
236
1. build / provide own query filters, sort and options parameters
236
237
2. query and append channels to the current channels state
237
238
3. update the `hasNext` pagination flag after each query with `setChannels` function
238
239
239
240
An example below implements a custom query function that uses different filters sequentially once a preceding filter is exhausted:
Custom handler invoked when the `ChannelPreview` is clicked. The SDK uses `ChannelPreview` to display items of channel search results. There, behind the scenes, the new active channel is set.
/** Custom UI component to display the container for the queried channels, defaults to and accepts same props as: [ChannelListMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListMessenger.tsx) */
/** Custom UI component to display the loading error indicator, defaults to and accepts same props as: [ChatDown](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChatDown/ChatDown.tsx) */
0 commit comments