2.1.2 • Published 2 years ago

react-select-states-and-lga-in-nigeria v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-select-states-and-lga-nigeria

select dropdown for nigerian states and lga

NPM JavaScript Style Guide

Install

npm install --save react-select-states-and-lga-in-nigeria

Usage

import React, { useState } from 'react'

import { Select } from 'react-select-states-and-lga-in-nigeria'
import 'react-select-states-and-lga-in-nigeria/dist/index.css'

//NOTE : The select button needs the state props, lga props, changeState props(this handles the state change and saves the value to state) and changeLga props(this handles the state change and saves the value to lga).

const [state, setState] = useState('')
const [lga, setLga] = useState('')

const handleStateChange = (e) => {
  setState(e.target.value)
}

const handleLgaChange = (e) => {
  setLga(e.target.value)
}
return (
  <Select
    state={state}
    lga={lga}
    changeState={handleStateChange}
    changeLga={handleLgaChange}
  />
)

License

MIT © https://github.com/esnonso

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago