Overview
useUpdateComment returns a function that updates an existing comment. At least one of content or metadata must be provided.
Usage Example
import { useUpdateComment } from "@replyke/react-js";
function EditComment({ commentId }: { commentId: string }) {
const updateComment = useUpdateComment();
const save = async (newContent: string) => {
const updated = await updateComment({ commentId, content: newContent });
console.log("Updated:", updated.id);
};
return <button onClick={() => save("Edited content")}>Save</button>;
}
Parameters
The ID of the comment to update.
New text content. Must be at least 1 character.
Replacement metadata object.
Returns