From 15a327a4809c248076ffb0b2f0d53103bfb8579d Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 4 Mar 2024 17:17:05 +0800 Subject: [PATCH] reduce warning log --- lib/config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index 46575239..25211f30 100644 --- a/lib/config.js +++ b/lib/config.js @@ -17,8 +17,11 @@ import { deepClone } from './utils' export const siteConfig = (key, defaultVal = null, extendConfig = null) => { let global = null try { + const isClient = typeof window !== 'undefined'; // eslint-disable-next-line react-hooks/rules-of-hooks - global = useGlobal() + global = isClient ? useGlobal() : {} + // eslint-disable-next-line react-hooks/rules-of-hooks + // global = useGlobal() } catch (error) {} // 首先 配置最优先读取NOTION中的表格配置