Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/instantsearch.js/src/lib/InstantSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ export type InstantSearchOptions<
*/
// @MAJOR: Remove legacy behaviour here and in algoliasearch-helper
persistHierarchicalRootCount?: boolean;
/**
* Experimental option to disable `renderState`
* @defualt false
*/
dontStoreRenderState?: boolean;
};
};

Expand All @@ -201,6 +206,7 @@ export const INSTANTSEARCH_FUTURE_DEFAULTS: Required<
> = {
preserveSharedStateOnUnmount: false,
persistHierarchicalRootCount: false,
dontStoreRenderState: false,
};

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/instantsearch.js/src/widgets/index/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,9 @@ function storeRenderState({
instantSearchInstance: InstantSearch;
parent?: IndexWidget;
}) {
if (instantSearchInstance.future.dontStoreRenderState) {
return;
}
const parentIndexName = parent
? parent.getIndexId()
: instantSearchInstance.mainIndex.getIndexId();
Expand Down