@@ -7,23 +7,21 @@ import {
77 SearchBox ,
88 useInstantSearch
99} from "react-instantsearch"
10- import { createInstantSearchRouterNext } from "react-instantsearch-router-nextjs"
11- import singletonRouter from "next/router"
10+ import { currentGeneralCourt } from "functions/src/shared"
1211import styled from "styled-components"
1312import TypesenseInstantSearchAdapter from "typesense-instantsearch-adapter"
14- import { currentGeneralCourt } from "functions/src/shared"
1513import { Col , Container , Row , Spinner } from "../../bootstrap"
1614import { NoResults } from "../NoResults"
1715import { ResultCount } from "../ResultCount"
1816import { SearchContainer } from "../SearchContainer"
1917import { SearchErrorBoundary } from "../SearchErrorBoundary"
18+ import { useRouting } from "../useRouting"
2019import { BillHit } from "./BillHit"
2120import { useBillRefinements } from "./useBillRefinements"
2221import { SortBy , SortByWithConfigurationItem } from "../SortBy"
2322import { getServerConfig , VirtualFilters } from "../common"
2423import { useBillSort } from "./useBillSort"
2524import { FC , useState } from "react"
26- import { pathToSearchState , searchStateToUrl } from "../routingHelpers"
2725
2826const searchClient = new TypesenseInstantSearchAdapter ( {
2927 server : getServerConfig ( ) ,
@@ -72,16 +70,8 @@ export const BillSearch = () => {
7270 }
7371 } }
7472 searchClient = { searchClient }
75- routing = { {
76- router : createInstantSearchRouterNext ( {
77- singletonRouter,
78- routerOptions : {
79- cleanUrlOnDispose : false ,
80- createURL : args => searchStateToUrl ( args ) ,
81- parseURL : args => pathToSearchState ( args )
82- }
83- } )
84- } }
73+ routing = { useRouting ( ) }
74+ future = { { preserveSharedStateOnUnmount : true } }
8575 >
8676 < VirtualFilters type = "bill" />
8777 < Layout items = { items } />
0 commit comments