simple-location-component
v1.0.1
Published
This is a super simple component that will give you country, state and let you write the city
Downloads
1
Readme
simple-location-component
This is a super simple component that will give you country, state and let you write the city
Install
npm install --save simple-location-component
Usage
import LocationCX from 'simple-location-component'
import 'simple-location-component/dist/index.css'
const App = () => {
const [state, setState] = useState({country:"", state:"", city:""} );
const onChange = (e) => {
const {name, value} = e.target;
// Update local state
setState({
...state,
[name]: value
})
}
// cols="2" Value of the columns in a row, considere the value for each one of the columns
// data={state} Your state
// onChange={onChange}
// extraStyleClasses="" May be you need add extra color or someting
return (
<LocationCX
cols="2" // Value of the columns in a row, considere the value for each one of the columns
data={state}
onChange={onChange}
extraStyleClasses=""
/>
)
}
export default App
License
MIT © anggar85