From 87eb5eaf53359013621127acc5be6fd7546020c3 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:33:25 +0200 Subject: [PATCH] Include location search in history stack --- src/util/useHistory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/useHistory.ts b/src/util/useHistory.ts index 840a8eb5..714e2c7e 100644 --- a/src/util/useHistory.ts +++ b/src/util/useHistory.ts @@ -39,10 +39,10 @@ export const useHistory = () => { updateHistory([...history.slice(0, -1)]); break; case NavigationType.Push: - updateHistory([...history, location.pathname]); + updateHistory([...history, location.pathname + location.search]); break; case NavigationType.Replace: - updateHistory([...history.slice(0, -1), location.pathname]); + updateHistory([...history.slice(0, -1), location.pathname + location.search]); break; default: throw new Error(`Unexpected NavigationType "${navigationType}"`);