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

# Use Downvote Comment

# `useDownvoteEntity`

## Overview

The `useDownvoteEntity` hook provides a way to downvote an entity.

## Usage Example

```tsx theme={null}
import { useDownvoteEntity } from "@replyke/react-js";
import { Button } from "@/components/ui/button";

function EntityComponent({ entityId }: { entityId: string }) {
  const downvoteEntity = useDownvoteEntity();

  const handleDownvote = async () => {
    try {
      const response = await downvoteEntity({ entityId });
      console.log("Entity downvoted:", response);
    } catch (err) {
      console.error("Failed to downvote:", err);
    }
  };

  return <Button onClick={handleDownvote}>Downvote</Button>;
}
```

## Parameters & Returns

### Parameters

The `downvoteEntity` function returned by the hook accepts a single object with the following field:

<ParamField path="entityId" type="string">
  The ID of the entity to be downvoted.
</ParamField>

### Returns

The function returns a `Promise<Entity>` representing the API response:

<ResponseField name="Updated comment" type="Entity">
  The updated entity after it is successfully downvoted.
</ResponseField>
