Skip to main content

Overview

useFetchComment returns a function that fetches a single comment by ID. The response wraps the comment in a { comment } object to allow future expansion of the response shape.

Usage Example

Parameters

commentId
string
required
The ID of the comment to fetch.
include
string | string[]
Populate related data. Accepted values: "user", "entity", "space", "parent".

Returns

comment
Comment
The fetched comment. When "parent" is included, comment.parentComment is populated. When spaceReputation is requested, the embedded author carries an added spaceReputation number. See Comment data model and Reputation.