react-select-us-states
v0.1.2
Published
React HTML Select component for US State Selection
Downloads
1,271
Readme
React Select US States
React HTML Select component for US State Selection.
Installation
The package can be installed via NPM:
npm install react-select-us-states --save
The list of US States were taken from here
Sample Usage:
import React, {Component} from 'react';
import './App.css';
import SelectUSState from 'react-select-us-states';
class App extends Component {
constructor(props) {
super(props);
this.setNewValue = this.setNewValue.bind(this);
}
setNewValue(newValue) {
console.log('this is the State code:' + newValue);
}
render() {
return (
<p>
Select a state: <SelectUSState id="myId" className="myClassName" onChange={this.setNewValue}/>
</p>
);
}
}
export default App;