diff --git a/docs/components/remote-view.md b/docs/components/remote-view.md index 2d6ef8406..8f35f365d 100644 --- a/docs/components/remote-view.md +++ b/docs/components/remote-view.md @@ -386,15 +386,16 @@ for fetching ESM views. | Prop | Type | Required? | Description | Default | | ------------------------ | --------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------- | ----------- | -| `urls` | String[] (URLs) | Yes | URLs of the ESM Views you want to load | N/A | +| `urls` | `string[]` (URLs) | Yes | URLs of the ESM Views you want to load | N/A | | `loadWithIframeFallback` | Function `fn(manifest: MicrofrontendManifest) => boolean` | No | Optional function to determine if an iframe fallback should be used in place of a React component. | `undefined` | ### `` -| Prop | Type | Required? | Description | Default | -| --------- | ------------ | --------- | --------------------------------------------------------------------------------------- | -------------------- | -| `url` | String (URL) | Yes | URL to the remote view. Can be either an ESM view URL on your ESM CDN, or an iframe URL | N/A | -| `loading` | JSX.Element | No | Display a custom loading component whilst the remote view is being fetched and rendered | `
Loading
` | +| Prop | Type | Required? | Description | Default | +| --------- | -------------- | --------- | --------------------------------------------------------------------------------------- | -------------------- | +| `url` | `string` (URL) | Yes | URL to the remote view. Can be either an ESM view URL on your ESM CDN, or an iframe URL | N/A | +| `loading` | `JSX.Element` | No | Display a custom loading component whilst the remote view is being fetched and rendered | `
Loading
` | +| `...args` | `unknown[]` | No | Optional props to pass through to the component that will be rendered. | `undefined` | `MicrofrontendManifest` represents the `package.json` of an ESM View served over an ESM CDN. This includes fields like the package `name`, `style`, diff --git a/packages/remote-view/src/components/remote-view.tsx b/packages/remote-view/src/components/remote-view.tsx index 029c69a99..49aa08ec6 100644 --- a/packages/remote-view/src/components/remote-view.tsx +++ b/packages/remote-view/src/components/remote-view.tsx @@ -4,15 +4,16 @@ import { useRemoteView } from '../hooks/useRemoteView'; interface Props { url: string; loading?: JSX.Element; + [args: string]: unknown; } function DefaultLoading() { return
Loading
; } -export function RemoteView({ url, loading }: Props) { +export function RemoteView({ url, loading, ...args }: Props) { const ViewComponent = useRemoteView(url); const loadingOutput = loading ? loading : ; - return (ViewComponent && ) || loadingOutput; + return (ViewComponent && ) || loadingOutput; }