# use-ens-name

> Display ENS names in a React app

Latest version **0.1.8** (published 2022-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-ens-name
pnpm add use-ens-name
yarn add use-ens-name
bun add use-ens-name
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2022-01-17 |
| First published | 2021-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | David Mihal |
| Maintainers | dmihal |

## Links

- npm: https://www.npmjs.com/package/use-ens-name
- Repository: https://github.com/dmihal/use-ens-name
- Issues: https://github.com/dmihal/use-ens-name/issues
- npm.io page: https://npm.io/package/use-ens-name

## Dependencies (1)

- [eth-ens-namehash](https://npm.io/package/eth-ens-namehash.md) ^2.0.8

## Recent versions

- 0.1.8 (latest) — 2022-01-17
- 0.1.7 — 2022-01-15
- 0.1.5 — 2022-01-15
- 0.1.4 — 2022-01-15
- 0.1.3 — 2021-12-20
- 0.1.2 — 2021-12-20
- 0.1.1 — 2021-12-20
- 0.1.0 — 2021-12-20

## 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 <div>ENS name: {name}</div>
}
```

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 <div>ENS name: {name}</div>
}
```

---
_Source: https://npm.io/package/use-ens-name · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
