From 71c9d5a7445c1b7d0c845b4bf730db05f9165ad0 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 28 Jan 2023 23:15:44 -0800 Subject: [PATCH] Replace native JS redirect with useRouter --- pages/new/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/new/index.tsx b/pages/new/index.tsx index 86907577..dc4fe4c9 100644 --- a/pages/new/index.tsx +++ b/pages/new/index.tsx @@ -35,8 +35,7 @@ const NewRoute: React.FC = ({ const router = useRouter() function callback(path: string) { - // This is scuffed, how do we do this natively? - window.history.replaceState(null, `Grid Tool`, `${path}`) + router.push(path, undefined, { shallow: true }) } useEffect(() => {