useCreateComment
Overview
TheuseCreateComment
hook allows users to add a new comment to an entity or reply to an existing comment. It supports optional mentions within the comment content, enabling tagging other users.
Usage Example
Parameters
The hook returns a function that accepts an object with the following fields:The ID of the entity to which the comment is added
If the comment is imported from an external dataset, use this to pass its ID
The ID of the parent comment (for threaded replies)
The text content of the comment
Object containing information about the GIF
An array of mentions to include in the comment
ID of a referenced comment (different from
parentCommentId
which is for threaded replies)Data about any attachments included with the comment
Extra free-form metadata
Returns
The newly created comment object with all its properties