> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replyke.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use comment section

> Access comment section state and actions from CommentSectionProvider

## Overview

`useCommentSection` reads from the nearest `CommentSectionProvider` and returns the full comment section state and actions. It does not fetch data itself — all data loading is managed by the provider.

<Note>
  `useCommentSection` must be used inside a `CommentSectionProvider`. See [Comment Section](/sdk/comments/comment-section) for setup and the full return value reference.
</Note>

## Usage Example

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

function CommentList() {
  const { comments, newComments, loading, hasMore, loadMore } = useCommentSection();

  return (
    <>
      {[...newComments, ...comments].map((comment) => (
        <div key={comment.id}>{comment.content}</div>
      ))}
      {hasMore && <button onClick={loadMore}>Load more</button>}
    </>
  );
}
```

See [Comment Section](/sdk/comments/comment-section) for the complete return value reference.
