This is the React InstantSearch v7 documentation.
If you’re upgrading from v6, see the upgrade guide.
If you were using React InstantSearch Hooks,
this v7 documentation applies—just check for necessary changes.
To continue using v6, you can find the archived documentation.
- Feature specific data from within your records to, for example, show promotional prices during a sales period
- Display advertisements or promotional banners.
To learn how to suppress InstantSearch’s initial ,
see Conditional requests.
Handle searches without results
When a query doesn’t return results, display a message and suggest changing the query or clearing filters.Display a message
To display a fallback message when a query doesn’t return results, use theuseInstantSearch Hook to create a wrapper component:
React
InfiniteHits or a custom component that uses the useHits Hook.
To prevent undesirable, additional search requests,
see Show and hide widgets.
Let users reset filters and facets
If users apply an overly specific configuration, they may not find any results. Account for this by letting them reset filters from the “no results” display so they can start another search. Do this with theClearRefinements widget.
React
Handle empty queries
By default, InstantSearch sends search requests even when the query is empty. To hide results until users enter a query, use the following wrapper. This hides the results without preventing search requests.React
Follow best practices for showing and hiding React InstantSearch widgets to prevent undesirable additional search requests.
Handle search errors
When an error occurs, you can display a specific piece of content to help users return to the standard state.React