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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCUMENTATION] Incorrect documentation on page "Conditional display in React Instantsearch" #6464

Open
1 task done
mmorris8 opened this issue Dec 5, 2024 · 0 comments
Open
1 task done
Labels
triage Issues to be categorized by the team

Comments

@mmorris8
Copy link

mmorris8 commented Dec 5, 2024

🐛 Current behavior

Page: https://www.algolia.com/doc/guides/building-search-ui/going-further/conditional-display/react/

In the section on Handling No Results a code sample is given to create a No Results boundary. After that code sample is this line

You can pass anything to display results, including [<InfiniteHits>](https://www.algolia.com/doc/api-reference/widgets/infinite-hits/react/) or a custom component that uses the [useHits()](https://www.algolia.com/doc/api-reference/widgets/hits/react/#hook) Hook.

That's flat out wrong. If you put an InfiniteHits component (Algolia's or any custom one) in a NoResultsBoundary that boundary will unmount the infiniteHits component briefly as it loads the next batch of results, then remount it. This wipes the state of the infiniteHits module and prevents it from working. I discovered this from personal painful experience and it took a day to debug. This line should be removed and replaced with a warning to not try to use a no results boundary with an infinite hits module.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mmorris8 mmorris8 added the triage Issues to be categorized by the team label Dec 5, 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