Do you want to request a feature or report a bug?
Bug
Bug: What is the current behavior?
Hi, I am using react-instantSearch with the connectAutoComplete connector using react-autosuggest. I am getting the following warning message:
setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the AlgoliaHighligher(Highlight) component.
This occurs when the hits (suggestions) list changes when typing a search input. I want to note that the Highlight component is nested withing the suggestion render component child components. If I unnest the Highlight component and move it to the parent component the warning seems to go away when the hits changes, but continues to display the warning if there are no hits found.
Please let me know if there might be a solution for this or if you might need additional information.
I provided a repo link below of a code/sample.
https://github.com/mrmojica/algolia-instantSearch-highlight/blob/master/src/Search.js
Thanks!!!
Thanks for your replication repository, we鈥檒l take a look at this ASAP!
This is luckily just a warning, so until we find the source and fix it, you can safely ignore it.
Thanks for the quick response!
I have a slight hunch that #150 is related. Can you try it with v4.0.4?
I was hoping it might have been due to the version, but we are using v4.04.
I'm seeing the same behaviour with 4.0.7.
I released a 4.0.8 and 4.1.0-beta.1 that fix this.
@mrmojica are you sure you were using 4.0.4 because the commit @Haroenv pointed was indeed the culprit.
Hmm, this is still happening for me with 4.0.8 although the issue in #150 seems to be fixed. (Sorry I originally posted this on the wrong issue).
@denkristoffer I ran your repo but wasn't able to reproduce the warning. It happens when you type something in the searchBox?
@mthuret Yes, and when I change the result page. I will see if I can extract some code to reproduce the problem and show it here.
I updated to 4.0.8 and no warnings! Thanks for all the help!