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:The ID of the conversation that contains the message.
The ID of the message to react to.
The emoji to toggle (e.g.
"👍", "❤️").Returns
Updated map of emoji to total count for this message.
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.

