InstantSearch
/
React
/
V6
/
API reference
Jan 16, 2025
ScrollTo | React InstantSearch V6 (Deprecated)
Deprecated content
This documentation is for a deprecated version of React InstantSearch.
Some features and settings may be missing or their usage may have changed.
Refer to the documentation for the
latest version of React InstantSearch for up-to-date information.
Signature
Signature
<ScrollTo // Optional parameters scrollOn={string} />
About this widget
The ScrollTo
widget makes the page scroll to the component wrapped by it when the searchState
is updated. By default when the page number changes, the scroll goes to the wrapped component.
Examples
Copy
1
2
3
4
5
import { ScrollTo, Hits } from 'react-instantsearch-dom';
<ScrollTo>
<Hits />
</ScrollTo>
Props
scrollOn
Optional
Type:
string
The widget state key to listen for changes. See the list of available keys by reading how the searchState
is structured.
Copy
1
2
3
<ScrollTo scrollOn="query">
<Hits/>
</ScrollTo>
Did you find this page helpful?