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.
Signature
About this widget
TherenderState
property provides all the data and functions from the widgets.
It lets you access the render state of any widget,
so you can create custom widgets or refine the search outside the InstantSearch lifecycle.
This is mainly useful for creating components that interact with multiple widgets at once, without mounting as many widgets.
A good example would be showing which filters of a hit are applied.
Examples
You can access the render state of thesearchBox
widget.
JavaScript
Working with virtual widgets
To access therenderState
of widgets, you must add them to InstantSearch.
If you don’t want to add a widget to the UI,
but want to get access to its renderState
,
you can add it as a virtual, or renderless widget.
JavaScript
Example: interactive categories in a hit
In this example, we want to display a list of categories in a hit, and let users refine the search by clicking on them.JavaScript
Type definition
TypeScript