React Hooks extensions to states-us npm package.
npm install react-us-statesReact Hooks module for the states-us package.



To install react-ntc with npm:
npm install react-us-states
To install react-ntc with yarn:
yarn add react-us-states
``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
];
`
`ts
useStates()
useStateMap()
useFullStateMap()
useStateTuples()
useStateNameLookup(abbreviation: string)
useStateObjectLookup(abbreviation: string)
``
View demo here: https://alehechka.github.io/react-us-states/
This project is licensed under the terms of the MIT license.