reactjsalgoliareact-instantsearch

Hot to use Algolia Places integration with react-instantsearch?


Does somebody have somewhere a simple Component example of Algolia Places used with react-instantsearch ? I am desperately trying to mix the two of them, but I can't figure out what to use : ? how ? It's written in the docs that we should have a HTMLInputElement as a required container option, so how do you deal with React where you shouldn't be able to touch the DOM ?

Cheers Arnaud


Solution

  • While waiting for Algolia to develop their own stuff, a simple solution exists, built here :

    1. Go to https://www.algolia.com/users/sign_up/places to get an API Key and an API Id (it's the most difficult part actually, as getting to this URL naturally on Algolia's website is so difficult that I didn't succeed yet).
    2. Get algolia-places-react, which is the package most customisable.
    3. Fill in your options as per the Read Me, and you're good to go !