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

# Use Fetch Follow Status

# `useFetchFollowStatus`

## Overview

The `useFetchFollowStatus` hook allows you to check whether the current logged-in user is following a specific user. It returns detailed follow information including the follow relationship status, follow ID, and when the follow occurred.

## Usage Example

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

function FollowStatusChecker({ targetUserId }: { targetUserId: string }) {
  const fetchFollowStatus = useFetchFollowStatus();

  const checkFollowStatus = async () => {
    try {
      const status = await fetchFollowStatus({ userId: targetUserId });
      if (status.isFollowing) {
        console.log(`Following since ${status.followedAt}`);
        console.log(`Follow ID: ${status.followId}`);
      } else {
        console.log("Not following this user");
      }
    } catch (error) {
      console.error("Failed to fetch follow status:", error.message);
    }
  };

  return <button onClick={checkFollowStatus}>Check Follow Status</button>;
}
```

## Parameters & Returns

### Parameters

The hook returns a function that accepts an object with the following field:

<ParamField path="userId" type="string" required>
  The ID of the user to check follow status for.
</ParamField>

### Returns

The function returns a Promise that resolves to an object containing:

<ResponseField name="isFollowing" type="boolean">
  Whether the current user is following the target user
</ResponseField>

<ResponseField name="followId" type="string?">
  The ID of the follow relationship (if following)
</ResponseField>

<ResponseField name="followedAt" type="string?">
  ISO date string of when the follow occurred
</ResponseField>

### Error Handling

The hook will throw errors in the following cases:

* No project is specified
* No user is logged in
* No user ID is provided
* Attempting to check follow status for yourself
