0.1.2 • Published 6 years ago

react-select-us-states v0.1.2

Weekly downloads
602
License
-
Repository
github
Last release
6 years ago

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;
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago