Skip to content

Commit

Permalink
Replace query params by default in Page Filters
Browse files Browse the repository at this point in the history
  • Loading branch information
adhityamamallan committed Nov 19, 2024
1 parent 976e514 commit 13dc37d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/page-filters/hooks/use-page-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function usePageFilters<P extends PageQueryParams>({
}) {
const [queryParams, setQueryParams] = usePageQueryParams(
pageQueryParamsConfig,
{ pageRerender: false }
{ replace: true, pageRerender: false }
);

const activeFiltersCount = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/use-page-query-params/use-page-query-params.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export default function usePageQueryParams<P extends PageQueryParams>(
return;
}
const replace =
extraConfig?.replace ?? setterExtraConfig?.replace ?? false;
setterExtraConfig?.replace ?? extraConfig?.replace ?? false;
const pageRerender =
extraConfig?.pageRerender ?? setterExtraConfig?.pageRerender ?? true;
setterExtraConfig?.pageRerender ?? extraConfig?.pageRerender ?? true;

const updatedUrlSearch = getUpdatedUrlSearch(config, newParams, search);
const routerNavigate = replace ? router.replace : router.push;
Expand Down

0 comments on commit 13dc37d

Please sign in to comment.