simple-location-component

1.0.1 • Public • Published

simple-location-component

This is a super simple component that will give you country, state and let you write the city

NPM JavaScript Style Guide

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

Readme

Keywords

none

Package Sidebar

Install

npm i simple-location-component

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

704 kB

Total Files

7

Last publish

Collaborators

  • anggar85