useAccountSubnames
Usage
import { useAccountSubnames } from '@justaname.id/react'
function AccountSubnamesComponent() {
const {
accountSubnames,
isAccountSubnamesPending,
isAccountSubnamesFetching,
isAccountSubnamesLoading,
refetchAccountSubnames
} = useAccountSubnames()
if (isAccountSubnamesLoading) return <div>Loading subnames...</div>
return (
<div>
<h3>Your Subnames</h3>
{accountSubnames?.map((record, index) => (
<div key={index}>
<strong>{record.ens}</strong>
<p>{record.sanitizedRecords?.description}</p>
<p>Claimed: {record.isClaimed ? 'Yes' : 'No'}</p>
</div>
))}
<button onClick={refetchAccountSubnames}>Refresh</button>
</div>
)
}Returns
Parameters
Defined in
Last updated