Skip to main content

Function: useReviewThread()

useReviewThread(reviewUri, options): UseQueryResult<ReviewThread, Error>

Defined in: web/lib/hooks/use-review.ts:272

Fetches a review thread (review with all nested replies).

Parameters

reviewUri

string

AT-URI of the parent review

options

UseReviewsOptions = {}

Hook options

Returns

UseQueryResult<ReviewThread, Error>

Query result with thread data

Remarks

Returns the full thread tree structure for unlimited-depth threading. The thread includes the parent review and all recursive replies.

Example

const { data } = useReviewThread(reviewUri);

return (
<ReviewThread
parent={data?.parent}
replies={data?.replies ?? []}
totalReplies={data?.totalReplies ?? 0}
/>
);