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

fix(useInstantSearch): results is null when first search is stalled #3597

Merged
merged 7 commits into from
Aug 25, 2022

Conversation

aymeric-giraudet
Copy link
Member

Summary

FX-1595

useSearchResults returns a null results when the first search is stalled.
This is because the render event is triggered when a search is stalled, in which case lastResults from the helper will be null.

Result

Added a test with a simulated stalled search which fails with the previous code, but is valid now

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 18, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 430984f:

Sandbox Source
react-instantsearch-app Configuration
hooks-example Configuration

@aymeric-giraudet aymeric-giraudet changed the title fix(useSearchResults): results is null when first search is stalled fix(useInstantSearch): results is null when first search is stalled Aug 18, 2022
@netlify
Copy link

netlify bot commented Aug 18, 2022

Deploy Preview for react-instantsearch ready!

Name Link
🔨 Latest commit 430984f
🔍 Latest deploy log https://app.netlify.com/sites/react-instantsearch/deploys/63078dd6b8240b0008548010
😎 Deploy Preview https://deploy-preview-3597--react-instantsearch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@aymeric-giraudet aymeric-giraudet changed the title fix(useInstantSearch): results is null when first search is stalled fix(useInstantSearch): results is null when first search is stalled Aug 24, 2022
Copy link
Member

@dhayab dhayab left a comment

Choose a reason for hiding this comment

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

Nice fix!

aymeric-giraudet and others added 3 commits August 25, 2022 16:57
…Results.test.tsx

Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com>
Co-authored-by: Sarah Dayan <5370675+sarahdayan@users.noreply.github.com>
@aymeric-giraudet aymeric-giraudet merged commit 6f71d78 into master Aug 25, 2022
@aymeric-giraudet aymeric-giraudet deleted the fix/rish-use-search-results-null-stalled branch August 25, 2022 15:19
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.

None yet

3 participants