# react-us-states

> React Hooks extensions to states-us npm package.

Latest version **1.0.2** (published 2020-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-us-states
pnpm add react-us-states
yarn add react-us-states
bun add react-us-states
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-09-10 |
| First published | 2020-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Adam Lehechka |
| Maintainers | alehechka |
| Keywords | react, reactjs, hooks, united states, usa, us, states, territories, abbreviations |

## Links

- npm: https://www.npmjs.com/package/react-us-states
- Repository: https://github.com/alehechka/react-us-states
- Homepage: https://github.com/alehechka/react-us-states#readme
- Issues: https://github.com/alehechka/react-us-states/issues
- npm.io page: https://npm.io/package/react-us-states

## Dependencies (1)

- [states-us](https://npm.io/package/states-us.md) ^1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-09-10
- 1.0.1 — 2020-09-07
- 1.0.0 — 2020-09-07

## README

# react-us-states

React Hooks module for the [states-us](https://www.npmjs.com/package/states-us) package.

[![npm version](https://img.shields.io/npm/v/react-us-states.svg?style=flat-square)](https://www.npmjs.com/package/react-us-states)
[![npm-publish](https://github.com/alehechka/react-us-states/workflows/npm-publish/badge.svg)](https://github.com/alehechka/react-us-states/actions)
[![npm downloads](https://img.shields.io/npm/dm/react-us-states.svg?style=flat-square)](https://www.npmjs.com/package/react-us-states)

## Installation

To install react-ntc with `npm`:

    npm install react-us-states

To install react-ntc with `yarn`:

    yarn add react-us-states

# Types

```ts
interface StateObject {
	name: string;
  abbreviation: string;
  territory: boolean;
  contiguous: boolean;
}

interface StateMap {
	[abbreviation: string]: string;
}

interface FullStateMap {
  [abbreviation: string]: StateObject;
}

type StateTuple = [
  name: string,
  abbreviation: string,
  territory: boolean,
  contiguous: boolean
];
```

# Hooks

```ts
useStates()

useStateMap()

useFullStateMap()

useStateTuples()

useStateNameLookup(abbreviation: string)

useStateObjectLookup(abbreviation: string)
```

# Demo

View demo here: [https://alehechka.github.io/react-us-states/](https://alehechka.github.io/react-us-states/)

## License

This project is licensed under the terms of the [MIT license](/LICENSE).

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