DocsReact HooksuseFollowingState

useFollowingState

The useFollowingState hook fetches and manages the following state between a given Ethereum address or ENS name and the connected user, indicating if the user follows, blocks, or mutes the address.

Add to your project

import { useFollowingState } from 'ethereum-identity-kit'
 
export default function FollowingStateComponent() {
  const { state, isLoading } = useFollowingState({
    lookupAddressOrName: 'vitalik.eth',
    connectedAddress: '0x1234...abcd',
  })
 
  // Create your own loading states
  if (isLoading) return <div>Loading...</div>
 
  // --- Your component code here ---
}

Parameters

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

Return Values

Return ValueDescription
stateThe following state, indicating if the user follows, blocks, or mutes the address.
isLoadingBoolean indicating if the following state is currently loading.