From a2d4494d4af409366419c33c4f56d444fd62fc32 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Wed, 24 Apr 2024 14:13:04 -0700 Subject: [PATCH] update --- react-manifest-example/host/@mf-types/index.d.ts | 4 ++-- react-manifest-example/host/src/navigation.tsx | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/react-manifest-example/host/@mf-types/index.d.ts b/react-manifest-example/host/@mf-types/index.d.ts index eed04952cd8..1b9f3dd0aff 100644 --- a/react-manifest-example/host/@mf-types/index.d.ts +++ b/react-manifest-example/host/@mf-types/index.d.ts @@ -1,5 +1,5 @@ -import type { PackageType as PackageType_0,RemoteKeys as RemoteKeys_0 } from './remote2/apis.d.ts'; -import type { PackageType as PackageType_1,RemoteKeys as RemoteKeys_1 } from './remote1/apis.d.ts'; +import type { PackageType as PackageType_0,RemoteKeys as RemoteKeys_0 } from './remote1/apis.d.ts'; +import type { PackageType as PackageType_1,RemoteKeys as RemoteKeys_1 } from './remote2/apis.d.ts'; declare module "@module-federation/runtime" { type RemoteKeys = RemoteKeys_0 | RemoteKeys_1; type PackageType = T extends RemoteKeys_0 ? PackageType_0 : diff --git a/react-manifest-example/host/src/navigation.tsx b/react-manifest-example/host/src/navigation.tsx index bf65e3cd42f..61f6ff1434c 100644 --- a/react-manifest-example/host/src/navigation.tsx +++ b/react-manifest-example/host/src/navigation.tsx @@ -4,12 +4,12 @@ import type { MenuProps } from 'antd'; import { Menu, Timeline } from 'antd'; import { GroupOutlined, HomeOutlined, SettingOutlined } from '@ant-design/icons'; - +import {preloadRemote} from '@module-federation/runtime' function Navgation () { let location = useLocation(); const [current, setCurrent] = useState(location.pathname); - + const items: MenuProps['items'] = [ { label: ( @@ -31,7 +31,15 @@ function Navgation () { }, { label: ( - + { + preloadRemote([ + { + nameOrAlias: 'remote2', + resourceCategory: 'all', + exposes: ['button'], + }, + ]); + }}> Remote2 ), @@ -47,4 +55,4 @@ function Navgation () { } -export default Navgation; \ No newline at end of file +export default Navgation;