From 96e1dd3f604286b61b4d294f396b6a6a14b69c42 Mon Sep 17 00:00:00 2001 From: VortexExpansion Date: Wed, 6 Nov 2024 14:06:45 +0900 Subject: [PATCH] fix array reduce for strict browser --- src/components/section/article/Article.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/section/article/Article.jsx b/src/components/section/article/Article.jsx index f090050..38f4dd2 100644 --- a/src/components/section/article/Article.jsx +++ b/src/components/section/article/Article.jsx @@ -40,10 +40,10 @@ export default function Article({ children }) { setContent(contentDirectory.article); } - // changes the searchParams object to a plain object - const params = searchParams - .entries() - .reduce((prev, [key, value]) => ({ ...prev, [key]: value }), {}); + const params = Array.from(searchParams.entries()).reduce( + (prev, [key, value]) => ({ ...prev, [key]: value }), + {}, + ); setParams(params); async function fetchTagName(categoryid, id) {