Skip to content

Commit

Permalink
Replace router replace with router push
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Nov 21, 2023
1 parent f69b419 commit 7ee68a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type SearchResultsBib from "../../src/models/SearchResultsBib"
* as well as displaying and controlling pagination and search filters.
*/
export default function Search({ results }) {
const { replace, query } = useRouter()
const { push, query } = useRouter()
const { itemListElement: searchResultsElements, totalResults } =
results.results

Expand All @@ -49,7 +49,7 @@ export default function Search({ results }) {

const handlePageChange = async (page: number) => {
const newQuery = getQueryString({ ...searchParams, page })
await replace(newQuery)
await push(newQuery)
}

return (
Expand Down

0 comments on commit 7ee68a5

Please sign in to comment.