import { useContext } from "react";
import { TypingContext } from "stream-chat-react-native";
const { typing } = useContext(TypingContext);TypingContext
TypingContext is provided by Channel. If you are not familiar with the React Context API, see the React docs.
Best Practices
- Use
useTypingContextfor consistent access and typings. - Treat
typingas read-only UI state. - Avoid heavy computations on the typing map during render.
- Consider disabling typing indicators in high-volume channels.
- Keep typing UI subtle and non-intrusive.
Basic Usage
Consume TypingContext in any child of Channel:
Alternatively, use the useTypingContext hook.
import { useTypingContext } from "stream-chat-react-native";
const { typing } = useTypingContext();Value
typing
A map of typing.start event objects keyed by user ID, for users currently typing.
| Type |
|---|
| object |