Skip to content

Commit 579822e

Browse files
fix(bridge-react): Add loading in root component to avoid CLS problem (#3973)
1 parent 0bf3a3a commit 579822e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/bridge/bridge-react/src/remote/component.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const RemoteAppWrapper = forwardRef(function (
2323
className,
2424
style,
2525
fallback,
26+
loading,
2627
...resProps
2728
} = props;
2829

@@ -104,7 +105,9 @@ const RemoteAppWrapper = forwardRef(function (
104105
// bridge-remote-root
105106
const rootComponentClassName = `${getRootDomDefaultClassName(moduleName)} ${className || ''}`;
106107
return (
107-
<div className={rootComponentClassName} style={style} ref={rootRef}></div>
108+
<div className={rootComponentClassName} style={style} ref={rootRef}>
109+
{loading}
110+
</div>
108111
);
109112
});
110113

packages/bridge/bridge-react/src/remote/create.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function createLazyRemoteComponent<
4444
providerInfo={exportFn}
4545
exportName={info.export || 'default'}
4646
fallback={info.fallback}
47+
loading={info.loading}
4748
ref={ref}
4849
{...props}
4950
/>

0 commit comments

Comments
 (0)