id | title |
---|---|
channel_state_context |
ChannelStateContext |
The ChannelStateContext
is a one of the context providers exposed in the Channel
component and is consumable by all of the Channel
children components.
The context provides all the state properties and logic for a channel
, and you can access these by calling the useChannelStateContext
custom hook.
Pull values from context with our custom hook:
const { channel, watchers } = useChannelStateContext();
The value is forwarded to the context from the Channel
component prop acceptedFiles
.
Type |
---|
string[] |
The currently active StreamChat
channel
instance to be loaded into the Channel
component and referenced by its children.
Type |
---|
object |
The allowed channel permissions for the currently connected user.
Type |
---|
object |
The configurations object for the currently active channel.
Type |
---|
object |
The read state maintained for use by components representing channel unread state (for example UnreadMessagesSeparator
, UnreadMessagesNotification
).
Property | Type | Description |
---|---|---|
last_read | Date |
Date when the channel was marked read the last time. |
unread_messages | number |
The count of unread messages in a given channel. Unread count refers only to foreign (not own) unread messages. |
first_unread_message_id | string or undefined |
The ID of the message that was marked unread (notification.mark_unread event). The value is available only when a message is marked unread. Therefore, cannot be relied on to place unread messages UI. |
last_read_message_id | string or undefined |
The ID of the message preceding the first unread message. |
Type |
---|
ChannelUnreadUiState |
The value is forwarded to the context from the Channel
component prop dragAndDropWindow
.
Type | Default |
---|---|
boolean | false |
Number of milliseconds to debounce firing the URL enrichment queries when typing. The default value is 1500(ms). See the guide Link Previews in Message Input for more.
Type | Default |
---|---|
number | 1500 |
The value is forwarded to the context from the Channel
component prop enrichURLForPreview
.
Type | Default |
---|---|
boolean | false |
Error object (if any) in loading the channel
, otherwise null.
Type |
---|
object |
Custom function to identify URLs in a string for later generation of link previews. See the guide Link Previews in Message Input for more.
Type |
---|
(text: string) => string[] |
The value is forwarded to the context from the Channel
component prop giphyVersion
.
Type | Default |
---|---|
string | 'fixed_height' |
The value is forwarded to the context from the Channel
component prop imageAttachmentSizeHandler
.
Type |
---|
(a: Attachment, e: HTMLElement) => ImageAttachmentConfiguration |
If the channel has more, older, messages to paginate through.
Type |
---|
boolean |
If the channel has more, newer, messages to paginate through.
Type |
---|
boolean |
Value is used internally for jump-to-message logic. Once the user "jumped" to the message, the message with the given ID is highlighted by manipulating its styles attribute.
Type |
---|
string |
Boolean for the channel
loading state.
Type |
---|
boolean |
Boolean for the channel
loading more messages.
Type |
---|
boolean |
Flag signalling whether newer messages are being loaded as the user scrolls down in the message list. Used internally by VirtualizedMessageList
.
Type |
---|
boolean |
The value is forwarded to the context from the Channel
component prop maxNumberOfFiles
.
Type | Default |
---|---|
number | 10 |
Members of this channel
(members are permanent, watchers are users who are online right now).
Type |
---|
object[] |
Array of message objects.
Type |
---|
object[] |
The value is forwarded to the context from the Channel
component prop multipleUploads
.
Type | Default |
---|---|
boolean | true |
An array of muted users for a channel
.
Type |
---|
object[] |
Temporary notifications added to the MessageList
on specific user/message actions.
Type |
---|
{id: string, text: string, type: 'success' | 'error'}[] |
Custom function to react to link preview dismissal. See the guide Link Previews in Message Input for more.
Type |
---|
(linkPreview: LinkPreview) => void |
The messages that are pinned in the channel
.
Type |
---|
object[] |
An inline message reply to another message.
Type |
---|
object |
The read state for each channel
member.
Type |
---|
object |
Flag signalling whether the scroll to the bottom is prevented. Used internally by MessageList
and VirtualizedMessageList
components.
Type |
---|
boolean |
The value is forwarded to the context from the Channel
component prop shouldGenerateVideoThumbnail
.
Type |
---|
boolean |
The parent message for a thread
, if there is one, otherwise null.
Type |
---|
object |
Boolean showing if there are more messages available in current active thread
, set to false when the end of pagination is reached.
Type |
---|
boolean |
If the thread is currently loading more messages.
Type |
---|
boolean |
Array of messages within a thread
.
Type |
---|
object[] |
Flag signalling whether the scroll to the bottom is prevented in thread. Used internally by MessageList
and VirtualizedMessageList
components.
Type |
---|
boolean |
The value is forwarded to the context from the Channel
component prop videoAttachmentSizeHandler
.
Type |
---|
(a: Attachment, e: HTMLElement) => VideoAttachmentConfiguration |
The number of watchers on the channel
.
Type |
---|
number |
An array of users who are currently watching the channel
.
Type |
---|
object[] |
The number of watchers on the channel
.
Type |
---|
number |