Skip to content

Commit

Permalink
fix: Use replace
Browse files Browse the repository at this point in the history
  • Loading branch information
antonjoel82 committed Feb 12, 2024
1 parent 7aa9927 commit b7b0728
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const useTabSearchParams = () => {
const [params, setParams] = useSearchParams(DEFAULT_PARAMS as unknown as URLSearchParamsInit);

const setTab = (tab: OnboardingUseCasesTabsEnum) => {
setParams({ [TAB_SEARCH_PARAM_NAME]: tab });
// replace is used so that changing the search params isn't considered a change in page
setParams({ [TAB_SEARCH_PARAM_NAME]: tab }, { replace: true });
};

const currentTab = (params.get(TAB_SEARCH_PARAM_NAME) as OnboardingUseCasesTabsEnum) ?? DEFAULT_TAB;
Expand Down

0 comments on commit b7b0728

Please sign in to comment.