react-select-states-and-lga-in-nigeria
v2.1.2
Published
select dropdown for nigerian states and lga
Downloads
22
Readme
react-select-states-and-lga-nigeria
select dropdown for nigerian states and lga
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}
/>
)