From 2e392db3715d74b7857b95d2f25b6596048d3fbe Mon Sep 17 00:00:00 2001 From: Frank Lyder Bredland Date: Fri, 2 Apr 2021 12:29:32 +0200 Subject: [PATCH] Refactor from function to const closure --- src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 3f7f367..b3185c0 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -28,7 +28,7 @@ const Home : React.FC = ({ bgcolor, textcolor, accentcolor, mdx, appData useEffect(() => { if(typeof window !== 'undefined') { - function onHashChange() { + const onHashChange = () => { const match = window.location.hash.match(/^\#([0-9a-f]{3,6})\-([0-9a-f]{3,6})\-([0-9a-f]{3,6})$/i); if(match !== null) { setStyle(makeStyle(