A React hook to fetch ENS records from a domain.

Overview

use-ens

A React hook to fetch ENS records from a domain.

Install

pnpm i use-ens

Example

CodeSandbox

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

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

  useEffect(() => {
      injected.isAuthorized().then((isAuth) => {
        if (isAuth) activate(injected)
      })
    }, [])

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

  return (
    <>
      <p>Address: {address ? address : ''}</p>
      <p>ENS Records</p>
      <ul>
        {records.web && Object.entries(records.web).map(([k, v]) => (
          <li>
            {k}: {v}
          </li>
        ))}
      </ul>
      {!active && <button onClick={() => activate(injected)}>Connect<button>}
    </>
  )
}
You might also like...

A tiny, SSR-friendly hook for listening to gamepad events.

useGamepadEvents useGamepadEvents is a tiny, SSR-friendly hook for listening to gamepad events. It's a wrapper around the Gamepad API designed for fir

Oct 2, 2022

Calculate the price range for property advertised on Domain and Real Estate.

Calculate the price range for property advertised on Domain and Real Estate.

Property Seeker Calculate the price range for property advertised on Domain and Real Estate. Install Chrome Firefox Edge Privacy All searches are perf

Dec 27, 2022

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.

Salesforce B2C Commerce / Customer 360 Platform Integration Introduction Salesforce B2C Commerce / CRM Sync is an enablement solution designed by Sale

Dec 9, 2022

Components and tools for building DeFi dapps on Solana + Anchor. Public domain license.

Solana DeFi Framework Components and tools for building DeFi dapps on Solana + Anchor. Public domain license. Status Pre-pre-pre-alpha. Contributing A

Mar 28, 2022

Seamlessly connect your web server to Rebrandly so that you can re-use your domain name for both your app and your short links

rebrandly-express Seamlessly connect your web server to Rebrandly so that you can re-use your domain name for both your app and your short links Rebra

Dec 13, 2022

This simple extension can automatically load NBN availability information for properties on realestate.com.au & domain.com.au including technology type, maximum line speed, and co-existance status if available.

This simple extension can automatically load NBN availability information for properties on realestate.com.au & domain.com.au including technology type, maximum line speed, and co-existance status if available.

NBN Availability Check Chrome Extension This simple extension can automatically load NBN availability information for properties on realestate.com.au

Aug 17, 2022

Use Cloudflare Pages Functions as a reverse proxy with custom domain support.

Use Cloudflare Pages Functions as a reverse proxy with custom domain support.

cf-page-func-proxy Use Cloudflare Pages Functions as a reverse proxy with custom domain support. Getting Start 1.下载或是Fork本仓库 2.修改_worker.js中的url.hostn

Dec 23, 2022

serverless plugin to setup custom domain for lambdas deployed with function url.

serverless-aws-function-url-custom-domain Automatically creates AWS CloudFront distribution and Route 53 records to AWS Lambda with Function URL (no a

Nov 27, 2022

HackFest is a 36-hour long hackathon wherein you have to put on your hacker hats and build anything that falls in either or both the domain of full-stack web development

HackFest is a 36-hour long hackathon wherein you have to put on your hacker hats and build anything that falls in either or both the domain of full-stack web development

HackFest is a 36-hour long hackathon wherein you have to put on your hacker hats and build anything that falls in either or both the domain of full-stack web development (the stack we learn in full-stack web developer roadmap on codedamn).

Jun 6, 2022
Owner
v 1 r t l
nullstack dev
v 1 r t l
A Leaderboard to keep track of your personal records or family's game

Leaderboard A Leaderboard to keep track of your personal records or family's game scores Built With HTML CSS Javascript Live Demo Live demo Mobile Tab

Victor Peralta 11 Mar 22, 2022
A full stack application that uses an authentication system to allow FAA Inspectors, Airliners, and Aircraft Technicians to update progress on their work all while keeping a log of records on projects completed.

A full stack application that uses an authentication system to allow FAA Inspectors, Airliners, and Aircraft Technicians to update progress on their work all while keeping a log of records on projects completed.

BinaryBitBytes 3 Jun 13, 2022
Awesome Books project with ES6 is an application that was built using Vanilla JavaScript with ES6 features like using arrow functions. This application allows you to keep records of your favorite books.

Javascript Project Awesome Books with ES6 Using Javascript to create a simple Awesome Books project. Populating the books list and then removing one b

Ghazanfar Ali 8 Sep 28, 2022
A Chrome extension for converting ENS names into links to daopanel chat.

daopanel connect A Chrome extension that links Twitter usernames to daopanel chat conversations Example daopanel chat is powered by XMTP Github Action

null 3 Aug 23, 2022
a quick lil project to help you set ens avatars.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Daksh Kulshrestha 7 Sep 26, 2022
Animated sprite hook for react-three-fiber

use-animated-sprite Animated sprite hook for react-three-fiber Dependencies npm install @react-three/drei @react-three/fiber react three Installation

Brit Gardner 7 Dec 4, 2022
🪝 React hook for subscribing to user's color scheme preference.

use-prefers-color-scheme React hook for subscribing to user's color scheme preference. ?? Getting Started ?? Jump Start npm install @anatoliygatt/use-

Anatoliy Gatt 30 Dec 19, 2022
Directus Hook Extension: Version Control Changelog

A Directus hook extension to push user written change summaries (from a singleton collection text field) to a changelog in a VCS server

BIX Digital Lab 11 Nov 27, 2022
An enchanced useState hook which keeps track of the states history, allowing you to undo and redo states.

useTimeline An enchanced useState hook which keeps track of the states history, allowing you to undo and redo states. useTimeline is a simple hook bas

null 13 Apr 22, 2022
A trpc-ified useReducer hook. ⚡

trpc-reducer A trpc-ified react useReducer hook that lets you perform state logic in reducers just like React's useReducer hook When you dispatch an a

gabriel-frattini 14 Aug 27, 2022