Skip to main content

Overview

Returns a function that fetches the total follower count of the currently authenticated user. For getting another user’s follower count, see useFetchFollowersCountByUserId.

Usage Example

import { useFetchFollowersCount } from "@replyke/react-js";

function FollowerCount() {
  const fetchFollowersCount = useFetchFollowersCount();
  const [count, setCount] = useState<number | null>(null);

  useEffect(() => {
    fetchFollowersCount().then((res) => setCount(res.count));
  }, []);

  return <span>{count ?? "..."} followers</span>;
}

Parameters

The hook returns a function that takes no parameters.

Returns

count
number
Total number of users following the current user.