ThreadContext
ThreadContext
is provided by Channel
component. If you are not familiar with React Context API, please read about it on React docs.
#
Basic UsageThreadContext
can be consumed by any of the child component of Channel
component as following:
import { useContext } from 'react';
import { ThreadContext } from 'stream-chat-react-native';
const value = useContext(ThreadContext);
Alternatively, you can also use useThreadContext
hook provided by library to consume ThreadContext.
import { useThreadContext } from 'stream-chat-react-native';
const value = useThreadContext();
#
Valueforwarded from Channel props allowThreadMessagesInChannel#
Display the Show thread message in channel button inside the thread MessageInput.
Type | Default |
---|---|
boolean | true |
closeThread
#
Unsets the thread and thread messages in the Channel state.
Type |
---|
function |
#
loadMoreThreadLoads more messages for the thread. Returns a promise.
Type |
---|
() => Promise<void> |
openThread
#
Sets the thread and thread messages in the Channel state.
Type |
---|
function |
reloadThread
#
Reloads the thread and thread messages.
Type |
---|
function |
#
setThreadLoadingMoreA function which can be used to set the thread loading more state.
Type |
---|
function |
forwarded from Channel props thread#
A message object that when set indicates a thread is open.
When used with the Thread
component this will display the thread.
When used with the standard MessageList
component this will prevent any singleton components in the OverlayProvider
form getting out of sync.
note
thread
should be set on all Channel
components when a thread is open.
Type |
---|
object |
#
threadHasMoreBoolean flag for thread messages pagination.
Type |
---|
boolean |
#
threadLoadingMoreBoolean flag for thread messages loading more state.
Type |
---|
boolean |
threadMessages
#
A list of formatted messages objects.
Type | |
---|---|
Array<object> |