react-nativealgoliareact-instantsearch

Algolia React Instantsearch - react native - 'query' search parameter not working


I'm using the react-instantsearch module on a React Native app. I'm using it as a controlled component, passing in a searchState like so:

  <InstantSearch
    appId='something'
    apiKey='somethingElse'
    indexName='index'
    searchState={this.props.algoliaSearchState}
  >

When I change the category (hierarchicalMenu) or location (aroundLatLng), this works fine, but when I change the query it has no effect on the hits that I get.

I can see that the query is being passed in (both by logging, and in react-native devtools: screenshot from devtools

Any ideas what could be going wrong here?


Solution

  • For a refinement to be applied, it needs to be present inside the search state and have a corresponding widget mounted.

    For hierarchicalMenu it's HierarchicalMenu, for aroundLatLng it's Configure and for query it's SearchBox.

    If you don't want any rendering for a widget just create a VirtualWidget. But for its refinement to be applied, it should be mounted.