Overview
Returns an async function that toggles an emoji reaction on a message. If the current user has not reacted with this emoji, it adds the reaction. If they have, it removes it. ThereactionCounts and userReactions on the message in Redux are updated after the server confirms the toggle.
Requires
ChatProvider in the component tree.Usage Example
Parameters
The hook returns a function. That function accepts:string
required
The ID of the conversation that contains the message.
string
required
The ID of the message to react to.
string
required
The emoji to toggle (e.g.
"👍", "❤️").Returns
Record<string, number>
Updated map of emoji to total count for this message.
string[]
Updated list of emojis the current user has reacted with on this message.
Notes
- Other participants see the reaction update in real-time via the
message:reactionsocket event, handled automatically byChatProvider. - For integration guidance, see Chat: Messages.

