Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(connectInfiniteHits): always provide an array for hits #1064

Merged
merged 2 commits into from
Mar 12, 2018

Conversation

samouss
Copy link
Collaborator

@samouss samouss commented Mar 9, 2018

Summary

In some cases it might happen that on the first render the results is not empty. It will happen if the component has been already mount previously for example. In that the case the widget will return an undefined value for this hits because all the condition are false. So we need to ensure that on every render the hits will be an array.

@samouss samouss requested review from vvo, bobylito, Haroenv and mthuret March 9, 2018 11:19
@algobot
Copy link
Contributor

algobot commented Mar 9, 2018

Deploy preview for react-instantsearch ready!

Built with commit 868bccb

https://deploy-preview-1064--react-instantsearch.netlify.com

@samouss samouss force-pushed the fix/infinite-hits-empty branch 2 times, most recently from c7f53e5 to 5774ad5 Compare March 9, 2018 12:30
Copy link
Contributor

@bobylito bobylito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@samouss samouss force-pushed the fix/infinite-hits-empty branch from 5774ad5 to 868bccb Compare March 12, 2018 08:34
@samouss samouss merged commit c75e38b into master Mar 12, 2018
@samouss samouss deleted the fix/infinite-hits-empty branch March 12, 2018 08:52
samouss added a commit that referenced this pull request Mar 12, 2018
<a name="5.0.1"></a>
## [5.0.1](v5.0.0...v5.0.1) (2018-03-12)

### Bug Fixes

* **connectInfiniteHits:** always provide an array for hits ([#1064](#1064)) ([c75e38b](c75e38b))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants