> ## Documentation Index
> Fetch the complete documentation index at: https://replyke-feat-push-rich-payload-fields.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch comment

> Fetch a single comment by its ID

## 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

```tsx theme={null}
import { useFetchComment } from "@sublay/react-js";

function DeepLinkComment({ commentId }: { commentId: string }) {
  const fetchComment = useFetchComment();

  const load = async () => {
    const { comment } = await fetchComment({
      commentId,
      include: ["user", "parent"],
    });
    console.log(comment);
  };

  return <button onClick={load}>Load Comment</button>;
}
```

## Parameters

<ParamField path="commentId" type="string" required>
  The ID of the comment to fetch.
</ParamField>

<ParamField path="include" type="string | string[]">
  Populate related data. Accepted values: `"user"`, `"entity"`, `"space"`, `"parent"`.
</ParamField>

<ParamField path="spaceReputationId" type="string">
  Optional. Resolves the embedded author's reputation into a `spaceReputation` number. Accepts a space `<uuid>`, `"none"` (project-general bucket), or `"context"` (server-derived from the request context). Empty string, `"general"`, and `null` are rejected. See [Reputation](/data-models/reputation).
</ParamField>

<ParamField path="spaceReputationDescendants" type="boolean">
  Optional. When `true`, `spaceReputation` is the subtree sum (the space plus all its descendants). Only honored when `spaceReputationId` is an explicit `<uuid>`.
</ParamField>

## Returns

<ResponseField name="comment" type="Comment">
  The fetched comment. When `"parent"` is included, `comment.parentComment` is populated. When `spaceReputationId` is set, the embedded author carries an added `spaceReputation` number. See [Comment data model](/data-models/comment) and [Reputation](/data-models/reputation).
</ResponseField>
