React wrapper for Algolia Places ![codecov](https://camo.githubusercontent.com/4a6849cf4a03af5aeb787766bf6419f4a08e88b94d6e3ae162e68376fec1dace/68747470733a2f2f636f6465636f762e696f2f67682f6b6f6e74726f6c6c616e74656e2f616c676f6c69612d706c616365732d72656163742f6272616e63682f6d61737465722f67726170682f62616467652e737667)
![Known Vulnerabilities](https://camo.githubusercontent.com/57f47df7e43ff6d37253e54df8ed6909b838eec0cc2dcf3b856fb7f8944aa6fd/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f6b6f6e74726f6c6c616e74656e2f616c676f6c69612d706c616365732d72656163742f62616467652e7376673f74617267657446696c653d7061636b6167652e6a736f6e)
![Build Status](https://camo.githubusercontent.com/75ae2ee2f482db4f152903fb1058c1fac27afea21fec99a776189daff7730227/68747470733a2f2f7472617669732d63692e6f72672f6b6f6e74726f6c6c616e74656e2f616c676f6c69612d706c616365732d72656163742e7376673f6272616e63683d6d6173746572)
Blazing fast address autocomplete React/preact component. ⚡
Checkout the demo at https://address-autocomplete-react.netlify.com/
npm install algolia-places-react --save
or
yarn add algolia-places-react
import React from 'react';
import AlgoliaPlaces from 'algolia-places-react';
export default () => {
return (
<AlgoliaPlaces
placeholder='Write an address here'
options={{
appId: 'my-app-id',
apiKey: 'sharing-is-caring',
language: 'sv',
countries: ['se'],
type: 'city',
// Other options from https://community.algolia.com/places/documentation.html#options
}}
onChange={({ query, rawAnswer, suggestion, suggestionIndex }) =>
console.log('Fired when suggestion selected in the dropdown or hint was validated.')}
onSuggestions={({ rawAnswer, query, suggestions }) =>
console.log('Fired when dropdown receives suggestions. You will receive the array of suggestions that are displayed.')}
onCursorChanged={({ rawAnswer, query, suggestion, suggestonIndex }) =>
console.log('Fired when arrows keys are used to navigate suggestions.')}
onClear={() =>
console.log('Fired when the input is cleared.')}
onLimit={({ message }) =>
console.log('Fired when you reached your current rate limit.')}
onError={({ message }) =>
console.log('Fired when we could not make the request to Algolia Places servers for any reason but reaching your rate limit.')}
/>
);
}
- Implement support for using Places methods
- Investigate using react-autocomplete instead. For smaller bundle and VDOM usage.