New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

use-ens

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-ens

A React hook to fetch ENS data

0.0.0-wip.0
Version published
Weekly downloads
39
18.18%
Maintainers
1
Weekly downloads
 
Created

use-ens

A React hook to fetch ENS data.

Install

pnpm i use-ens

Usage

import React from 'react'
import { useWeb3React } from '@web3-react/core'
import { useENS } from 'use-ens'

const App = () => {
  const { provider } = useWeb3React()

  const { address, records } = useENS(provider)('example.eth')

  return (
    <>
      <p>Address: {address ? address : ''}</p>
      <p>ENS Records</p>
      <ul>
        {Object.entries(records).map(([k, v]) => (
          <li>
            {k}: {v}
          </li>
        ))}
      </ul>
    </>
  )
}

FAQs

Package last updated on 11 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts