Skip to content

Commit

Permalink
Enhance FederatedComponent with generic props for shell hooks and alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
hervedombya committed Nov 26, 2024
1 parent 1298157 commit d5d651c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ModuleFederation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export type FederatedComponentProps = {
module: string;
};

export type FederateAppProps<T, U> = {
shellHooks: T;
shellAlerts: U;
};

export type SolutionUI = {
kind: string;
url: string;
Expand All @@ -75,15 +80,15 @@ export type SolutionUI = {
appHistoryBasePath: string;
};

export function FederatedComponent({
export function FederatedComponent<T, U>({
url,
scope,
module,
app,
renderOnLoading,
props,
}: FederatedComponentProps & {
props: any;
props: FederateAppProps<T, U>;
app: SolutionUI;
renderOnLoading?: ReactNode;
}) {
Expand Down

0 comments on commit d5d651c

Please sign in to comment.