From ae066d850e9a3c5154205081e752a50dece49f3d Mon Sep 17 00:00:00 2001 From: Chuma McPhoy Date: Mon, 12 Aug 2024 11:07:41 +0200 Subject: [PATCH] fix(feat-SW-94): use function declarations --- hooks/useHash.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hooks/useHash.tsx b/hooks/useHash.tsx index 8a3990122..1dadf8b8b 100644 --- a/hooks/useHash.tsx +++ b/hooks/useHash.tsx @@ -3,10 +3,11 @@ import { useParams } from "next/navigation" import { useEffect, useState } from "react" -const getHash = () => - typeof window !== "undefined" ? window.location.hash : undefined +function getHash() { + return typeof window !== "undefined" ? window.location.hash : undefined +} -const useHash = () => { +function useHash() { const [isClient, setIsClient] = useState(false) const [hash, setHash] = useState(getHash()) const params = useParams()