useComments
function useComments(activityId): object;Comments on one activity. Lists the first page on mount and when activityId
changes. Does not poll. The page size is the server default (20). hasNext is
true when another page exists; loadNext appends it.
add appends an optimistic row, swaps in the server row on success, and on failure
— including CONTENT_REJECTED, which stored nothing — removes the row, sets
error, and rejects.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activityId |
string |
Returns
Section titled “Returns”object
add: (text) => Promise<void> = thread.add;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”Promise<void>
comments
Section titled “comments”comments: Comment[] = thread.rows;enabled
Section titled “enabled”enabled: boolean = thread.enabled;error: Error | null = thread.error;hasNext
Section titled “hasNext”hasNext: boolean = thread.hasNext;isLoading
Section titled “isLoading”isLoading: boolean = thread.isLoading;loadNext
Section titled “loadNext”loadNext: () => Promise<void> = thread.loadNext;Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”The network error after the optimistic row has been removed.