algolia / algolia/instantsearch
[DOCUMENTATION] Incorrect documentation on page "Conditional display in React Instantsearch"
- Dominant language
- TypeScript
- Stars
- 4.1k
- Forks
- 553
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 51
Description
### 🐛 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 [](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
- [X] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Open the linked React InstantSearch documentation page and read the “Handling No Results” section, especially the No Results boundary example and following text. Update that passage so it no longer recommends InfiniteHits inside the boundary and clearly warns about the reported remounting behavior. Done means the page accurately describes the limitation and no longer suggests that usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100