Overview
useReplies loads replies for a specific comment from the entityCommentsTree managed by the nearest CommentSectionProvider. It fetches a page of replies when the page state increases above 0.
Must be used inside a
CommentSectionProvider. Replies are merged into the shared entityCommentsTree.Usage Example
Props
string
required
The ID of the comment to load replies for.
CommentsSortByOptions
required
Sort order for replies:
"createdAt" or "top". "new"/"old" are deprecated aliases for "createdAt" (removed in v8)."asc" | "desc"
Sort direction for
sortBy: "createdAt". Default: "desc" (newest first).Return Values
(Comment & { new: boolean })[]
Paginated replies (not newly submitted in this session).
(Comment & { new: boolean })[]
Replies submitted in this session, sorted newest-first.
boolean
true while replies are being fetched.number
Current page number. Starts at
0 (no replies loaded). Increment to load replies.Dispatch<SetStateAction<number>>
Increment to trigger loading the next page of replies.

