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:

import { useMessageComposerAPIContext } from "stream-chat-react-native";

const { setEditingState, clearEditingState } = useMessageComposerAPIContext();

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.

TypeDescription
(message: LocalMessage | undefined) => voidSets the editing state of the message composer.

clearEditingState

Function to clear the editing state of the message composer.

TypeDescription
() => voidClears the editing state of the message composer.

setQuotedMessage

Function to set the quoted message in the message composer.

TypeDescription
(message: LocalMessage | undefined) => voidSets the quoted message in the message composer.

© Getstream.io, Inc. All Rights Reserved.