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.
A deleted or removed message takes no new reaction: adding one answers 404 chat/message-not-found, while taking back your own still works. On such a message, offer only the reactions in userReactions, to take back.
Requires
ChatProvider in the component tree.Usage Example
Parameters
The hook returns a function. That function accepts:Returns
Notes
- Other participants see the reaction update in real-time via the
message:reactionsocket event, handled automatically byChatProvider. - For integration guidance, see Chat: Messages.

