File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
client/packages/lowcoder/src/comps/comps/remoteComp Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { loaders } from "./loaders";
13
13
import { withErrorBoundary } from "comps/generators/withErrorBoundary" ;
14
14
import { EditorContext } from "@lowcoder-ee/comps/editorState" ;
15
15
import { CompContext } from "@lowcoder-ee/comps/utils/compContext" ;
16
+ import React from "react" ;
16
17
17
18
const ViewError = styled . div `
18
19
display: flex;
@@ -53,7 +54,7 @@ interface RemoteCompViewProps {
53
54
errorElement ?: ( error : any ) => React . ReactNode ;
54
55
}
55
56
56
- function RemoteCompView ( props : React . PropsWithChildren < RemoteCompViewProps > ) {
57
+ const RemoteCompView = React . memo ( ( props : React . PropsWithChildren < RemoteCompViewProps > ) => {
57
58
const { loadComp, loadingElement, errorElement, isLowcoderComp } = props ;
58
59
const [ error , setError ] = useState < any > ( "" ) ;
59
60
const editorState = useContext ( EditorContext ) ;
@@ -93,11 +94,9 @@ function RemoteCompView(props: React.PropsWithChildren<RemoteCompViewProps>) {
93
94
}
94
95
95
96
return (
96
- < ViewLoadingWrapper >
97
- < WhiteLoading />
98
- </ ViewLoadingWrapper >
97
+ < WhiteLoading />
99
98
) ;
100
- }
99
+ } ) ;
101
100
102
101
export function remoteComp < T extends RemoteCompInfo = RemoteCompInfo > (
103
102
remoteInfo ?: T ,
You can’t perform that action at this time.
0 commit comments