Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dmihal/use-ens-name


https://github.com/dmihal/use-ens-name

Last synced: 23 days ago
JSON representation

Awesome Lists containing this project

README

        

# use-ens-name

Simple React hook for displaying ENS names (Ethereum name service).

## Instalation

```
yarn add use-ens-name
```

## Usage

```jsx
import { useENSName } from 'use-ens-name';

const MyComponent = ({ address }) => {
const name = useENSName(address)

return

ENS name: {name}

}
```

The hook will return `null` when loading, or when no name is found. You can also pass a fallback string:

```jsx
import { useENSName } from 'use-ens-name';

const MyComponent = ({ address }) => {
const name = useENSName(address, '(unknown)')

return

ENS name: {name}

}
```