fix: init default value
CI / build (16.x, ubuntu-latest) (push) Has been cancelled Details
CI / build (16.x, windows-latest) (push) Has been cancelled Details
CI / build (18.x, ubuntu-latest) (push) Has been cancelled Details
CI / build (18.x, windows-latest) (push) Has been cancelled Details

This commit is contained in:
ClarkXia 2025-04-01 14:10:38 +08:00
parent 8a6a2e7890
commit 295e926ad5
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ const runtime: RuntimePlugin = ({ getAppRouter, setAppRouter, appContext }) => {
const [routeInfo, setRouteInfo] = useState<RouteInfo>({});
const [appEnter, setAppEnter] = useState<AppConfig>({});
const [appLeave, setAppLeave] = useState<AppConfig>({});
const [apps, setApps] = useState<AppConfig[]>([]);
const [apps, setApps] = useState<AppConfig[] | null>(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 }) => {
<FrameworkLayout {...appInfo}>
{apps && (
<AppRouter {...appRouterProps}>
{apps.map((item: AppConfig, idx: number) => (
{apps?.map((item: AppConfig, idx: number) => (
<AppRouteComponent key={idx} {...item} />
))}
<AppRouteComponent