import { useMessageComposerAPIContext } from "stream-chat-react-native";
const { setEditingState, clearEditingState } = useMessageComposerAPIContext();
This is documentation for the release candidate
Stream Chat React Native SDK v8. For the latest stable version, see the latest version (v7).
MessageComposerAPIContext
MessageComposerAPIContext
is provided by Channel
component. If you are not familiar with React Context API, please read about it on React docs.
Basic Usage
MessageComposerAPIContext
can be consumed by any of the child component of Channel
component as following:
If you are curious about how to get the editing
and the quotedMessage
state, you can do that from the useMessageComposer
hook exported from the SDK.
import { useMessageComposer } from "stream-chat-react-native";
const { editedMessage, quotedMessage } = useMessageComposer();
Value
setEditingState
Function to set the editing state of the message composer.
Type | Description |
---|---|
(message: LocalMessage | undefined) => void | Sets the editing state of the message composer. |
clearEditingState
Function to clear the editing state of the message composer.
Type | Description |
---|---|
() => void | Clears the editing state of the message composer. |
setQuotedMessage
Function to set the quoted message in the message composer.
Type | Description |
---|---|
(message: LocalMessage | undefined) => void | Sets the quoted message in the message composer. |