Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf50ad38

Browse files
memoize remoteCompView
1 parent2304cd9 commitf50ad38

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

‎client/packages/lowcoder/src/comps/comps/remoteComp/remoteComp.tsx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { loaders } from "./loaders";
1313
import{withErrorBoundary}from"comps/generators/withErrorBoundary";
1414
import{EditorContext}from"@lowcoder-ee/comps/editorState";
1515
import{CompContext}from"@lowcoder-ee/comps/utils/compContext";
16+
importReactfrom"react";
1617

1718
constViewError=styled.div`
1819
display: flex;
@@ -53,7 +54,7 @@ interface RemoteCompViewProps {
5354
errorElement?:(error:any)=>React.ReactNode;
5455
}
5556

56-
functionRemoteCompView(props:React.PropsWithChildren<RemoteCompViewProps>){
57+
constRemoteCompView=React.memo((props:React.PropsWithChildren<RemoteCompViewProps>)=>{
5758
const{ loadComp, loadingElement, errorElement, isLowcoderComp}=props;
5859
const[error,setError]=useState<any>("");
5960
consteditorState=useContext(EditorContext);
@@ -93,11 +94,9 @@ function RemoteCompView(props: React.PropsWithChildren<RemoteCompViewProps>) {
9394
}
9495

9596
return(
96-
<ViewLoadingWrapper>
97-
<WhiteLoading/>
98-
</ViewLoadingWrapper>
97+
<WhiteLoading/>
9998
);
100-
}
99+
});
101100

102101
exportfunctionremoteComp<TextendsRemoteCompInfo=RemoteCompInfo>(
103102
remoteInfo?:T,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp