react-us-states
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

react-us-states

React Hooks module for the states-us package.

npm version npm-publish npm downloads

Installation

To install react-ntc with npm:

npm install react-us-states

To install react-ntc with yarn:

yarn add react-us-states

Types

interface StateObject {
    name: string;
  abbreviation: string;
  territory: boolean;
  contiguous: boolean;
}
 
interface StateMap {
    [abbreviation: string]: string;
}
 
interface FullStateMap {
  [abbreviation: string]: StateObject;
}
 
type StateTuple = [
  namestring,
  abbreviationstring,
  territoryboolean,
  contiguousboolean
];

Hooks

useStates()
 
useStateMap()
 
useFullStateMap()
 
useStateTuples()
 
useStateNameLookup(abbreviationstring)
 
useStateObjectLookup(abbreviationstring)

Demo

View demo here: https://alehechka.github.io/react-us-states/

License

This project is licensed under the terms of the MIT license.

Package Sidebar

Install

npm i react-us-states

Weekly Downloads

266

Version

1.0.2

License

MIT

Unpacked Size

16.2 kB

Total Files

11

Last publish

Collaborators

  • alehechka