Refresh Hits React Native

Hey guys!

I’m currently using Algolia to search through my firebase database on React Native, which works beautifully. However, I am having trouble when updating items or removing items in Algolia. After removing or updating an item in algolia, my search results on my front-end still show that the items exist when searching for them (I’m guessing due to some sort of cache with the hits?). My setup is almost exactly like the react native guide, made entirely with the help of connectors. The hits are only updated after I have reloaded my application, which is not the functionality that I am looking for. I have tried dynamically rendering the Hits component as shown below, but this does not update the hits. Any ideas would be great!

      onSearchStateChange={(searchState) => this.setState({searchState}) }
      {this.state.searchState.query !== '' ?
      /> : <Text> Start searching!</Text> } 

I fixed it! A little hacky but it does the job:

var algoliasearch = require('algoliasearch/reactnative');
var client = algoliasearch(...);

Popped this into my render function

let searchState = this.state.searchState || {query: ''}
if (searchState.query == '')

Hi @laurentlousky1,

Currently you can do it with hacky stuff like you did :slight_smile: Just to let you know we are working on adding a new API for this =>

If you want to provide ideas for this, don’t hesitate :slight_smile: