1.0.3 • Published 8 years ago
googlePlaceAutocomplete v1.0.3
GooglePlaceAutocomplete component for ReactJS
Wrapper on top of the material-ui AutoComplete component that use google place api
Installation
Add this script to your html page:
<head>
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
</head>
Material-ui is required:
npm install material-ui
npm install googlePlaceAutocomplete
Features
- AutoComplete that auto-load google places
Getting started
<GooglePlaceAutocomplete searchText={'paris'}
onChange={onAutoCompleteInputChangeFct}
onNewRequest={onClickLocationFct}
name={'location'}
/>
Props:
Same as AutoComplete material-ui component (http://www.material-ui.com/#/components/auto-complete)
onNewRequest: function -> (selectedData, searchedText, selectedDataIndex)
Development
npm run build
- produces production versionnpm run dev
- produces development versionnpm test
- run the tests