Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

useInfiniteHits is not returning hits in specific scenario #6102

Open
1 task done
iFiz opened this issue Mar 22, 2024 · 0 comments
Open
1 task done

useInfiniteHits is not returning hits in specific scenario #6102

iFiz opened this issue Mar 22, 2024 · 0 comments
Labels
triage Issues to be categorized by the team

Comments

@iFiz
Copy link

iFiz commented Mar 22, 2024

馃悰 Current behavior

Hi! I ran into a weird issue while using the useInfiniteHits hook. When useInfiniteHits is used together with useDynamicWidgets and there are no filters present on the page, no hits will be returned. useInstantSearch will still return hits. This only happens when solely rendering on the client side, it works fine if the content is rendered on the server side beforehand.

We've since found a workaround for this issue by moving useDynamicWidgets to a component that's only rendered whenever filters are present on this page, circumventing the issue. However, I am still wondering if this is intended behavior and if this is a bug or an implementation issue.

Thanks in advance!

馃攳 Steps to reproduce

  1. Rely on client-side rendering only
  2. Retrieve hits from the useInfiniteHits hook
  3. Use useDynamicWidgets
  4. Have no filters on the page

Live reproduction

https://codesandbox.io/p/sandbox/flamboyant-rosalind-9h48gq?file=%2Fsrc%2FCustomHits.tsx

馃挱 Expected behavior

I expected hits to be returned from useInfiniteHits as normal, instead no hits are returned.

Package version

react-instantsearch: 7.6.0, instantsearch.js: 4.65.0

Operating system

No response

Browser

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@iFiz iFiz added the triage Issues to be categorized by the team label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

1 participant