From 295e926ad564bb125ca1a16b2d7467140af6ee31 Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Tue, 1 Apr 2025 14:10:38 +0800 Subject: [PATCH] fix: init default value --- packages/plugin-icestark/src/runtime/framework.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-icestark/src/runtime/framework.tsx b/packages/plugin-icestark/src/runtime/framework.tsx index 64afb479b..fffc2484f 100644 --- a/packages/plugin-icestark/src/runtime/framework.tsx +++ b/packages/plugin-icestark/src/runtime/framework.tsx @@ -23,7 +23,7 @@ const runtime: RuntimePlugin = ({ getAppRouter, setAppRouter, appContext }) => { const [routeInfo, setRouteInfo] = useState({}); const [appEnter, setAppEnter] = useState({}); const [appLeave, setAppLeave] = useState({}); - const [apps, setApps] = useState([]); + const [apps, setApps] = useState(null); const FrameworkLayout = layout || React.Fragment; const appInfo = { pathname: routeInfo.pathname || (typeof window !== 'undefined' ? window.location.pathname : ''), @@ -64,7 +64,7 @@ const runtime: RuntimePlugin = ({ getAppRouter, setAppRouter, appContext }) => { {apps && ( - {apps.map((item: AppConfig, idx: number) => ( + {apps?.map((item: AppConfig, idx: number) => ( ))}