Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy committed Apr 24, 2024
1 parent a1be1ec commit a2d4494
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions react-manifest-example/host/@mf-types/index.d.ts
Original file line number Diff line number Diff line change
@@ -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, Y=any> = T extends RemoteKeys_0 ? PackageType_0<T> :
Expand Down
16 changes: 12 additions & 4 deletions react-manifest-example/host/src/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: (
Expand All @@ -31,7 +31,15 @@ function Navgation () {
},
{
label: (
<Link to="/remote2">
<Link to="/remote2" onMouseEnter={()=>{
preloadRemote([
{
nameOrAlias: 'remote2',
resourceCategory: 'all',
exposes: ['button'],
},
]);
}}>
Remote2
</Link>
),
Expand All @@ -47,4 +55,4 @@ function Navgation () {

}

export default Navgation;
export default Navgation;

0 comments on commit a2d4494

Please sign in to comment.