<InstantSearchNext>
This is the React InstantSearch v7 documentation. React InstantSearch v7 is the latest version of React InstantSearch and the stable version of React InstantSearch Hooks.
If you were using React InstantSearch v6, you can upgrade to v7.
If you were using React InstantSearch Hooks, you can still use the React InstantSearch v7 documentation, but you should check the upgrade guide for necessary changes.
If you want to keep using React InstantSearch v6, you can find the archived documentation.
<InstantSearchNext
indexName={string}
searchClient={object}
// Optional props
initialUiState={object}
onStateChange={function}
stalledSearchDelay={number}
routing={boolean | object}
insights={boolean | object}
future={{
preserveSharedStateOnUnmount: boolean,
persistHierarchicalRootCount: boolean,
}}
instance={object}
ignoreMultipleHooksWarning={boolean}
>
{children}
</InstantSearchNext>
1
import { InstantSearchNext } from 'react-instantsearch-nextjs';
About this component
This component replaces <InstantSearch> in Next.js App Router applications. It supports server-side rendering and routing.
See <InstantSearch> for more information on their common props. Only the props that differ from <InstantSearch> are documented here.
Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
'use client';
import { InstantSearchNext } from 'react-instantsearch-nextjs';
export function Search() {
return (
<InstantSearchNext
indexName="instant_search"
searchClient={searchClient}
>
{/* Widgets */}
</InstantSearchNext>
);
}
Check the Next.js App router example for full markup.
Parameters
routing
|
type: boolean | RoutingProps
default: false
Optional
Enables routing for the search state. If set to |
||
|
Copy
|
|||
instance
|
type: InstantSearch
Optional
Allows you to pass an existing instance of You can create an instance using the |
||
|
Copy
|
|||
ignoreMultipleHooksWarning
|
type: boolean
default: false
Optional
If set to |
||
|
Copy
|
|||