DocsReact HooksuseFollowerState

useFollowerState

The useFollowerState hook fetches and manages the follower state between a given Ethereum address or ENS name and the connected user, indicating if the user is followed, blocked, or muted by the address.

Add to your project

import { useFollowerState } from 'ethereum-identity-kit'
 
export default function FollowerStateComponent() {
  const { followState, followerTag, isFollowerStateLoading } = useFollowerState({
    addressOrName: 'vitalik.eth',
    connectedAddress: '0x1234...abcd',
  })
 
  // Create your own loading states
  if (isFollowerStateLoading) return <div>Loading...</div>
 
  // --- Your component code here ---
}

Parameters

ParameterDescriptionRequiredDefault Value
addressOrNameEthereum Address or ENS name to check the follower state for.Yes-
connectedAddressEthereum address of the currently connected user.Yes-
listList number to check the follower state for; overrides addressOrName if provided.No-

Return Values

Return ValueDescription
followStateThe follower state, indicating if the user is followed, blocked, or muted by the address.
followerTagObject containing text and className for displaying the follower state.
isFollowerStateLoadingBoolean indicating if the follower state is currently loading.