From 7c7c83bc4325bd175334710ac52807f5e7194636 Mon Sep 17 00:00:00 2001 From: Dunemask Date: Mon, 26 Dec 2022 19:49:00 -0500 Subject: [PATCH] Adjusted hash routing --- src/hooks.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks.jsx b/src/hooks.jsx index 3627c7b..60238e5 100644 --- a/src/hooks.jsx +++ b/src/hooks.jsx @@ -12,11 +12,11 @@ export function useScrollToLocation() { hashRef.current = hash; scrolledRef.current = false; } + navigate(); if (scrolledRef.current) return; const id = hash.replace("#", ""); const element = document.getElementById(id); if (!element) return; - navigate(); element.scrollIntoView({ behavior: "smooth", block: "start" }); scrolledRef.current = true; });