> ## 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 Remove Comment Upvote

# `useRemoveEntityUpvote`

## Overview

The `useRemoveEntityUpvote` hook provides a way to remove a previously cast upvote from an entity.

## Usage Example

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

function EntityComponent({ entityId }: { entityId: string }) {
  const removeUpvote = useRemoveEntityUpvote();

  const handleRemoveUpvote = async () => {
    try {
      const response = await removeUpvote({ entityId });
      console.log("Upvote removed:", response);
    } catch (err) {
      console.error("Failed to remove upvote:", err);
    }
  };

  return <Button onClick={handleRemoveUpvote}>Remove Upvote</Button>;
}
```

## Parameters & Returns

### Parameters

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

<ParamField path="entityId" type="string">
  The ID of the entity whose upvote to remove.
</ParamField>

### Returns

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

<ResponseField name="Updated comment" type="Entity">
  The updated entity after the upvote is successfully removed.
</ResponseField>
