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

Commit5a43440

Browse files
memoize cacheView and cachePropertyView
1 parentfe9a35c commit5a43440

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const TmpComp = withTypeAndChildren<
6262
childrenMap
6363
);
6464

65-
functionCachedView(props:{comp:Comp;name:string}){
65+
constCachedView=React.memo((props:{comp:Comp;name:string})=>{
6666
returnReact.useMemo(
6767
()=>(
6868
<Profilerid={props.name}onRender={profilerCallback}>
@@ -73,13 +73,13 @@ function CachedView(props: { comp: Comp; name: string }) {
7373
),
7474
[props.comp,props.name]
7575
);
76-
}
76+
})
7777

78-
functionCachedPropertyView(props:{
78+
constCachedPropertyView=React.memo((props:{
7979
comp:Comp;
8080
name:string;
8181
withParamsContext:WithParamsContext;
82-
}){
82+
})=>{
8383
constprevHints=useContext(CompExposingContext);
8484
const{ withParamsContext}=props;
8585
consthints=useMemo(
@@ -109,7 +109,7 @@ function CachedPropertyView(props: {
109109
</>
110110
);
111111
},[props.comp,props.name,hints,searchText,setSearchText]);
112-
}
112+
});
113113

114114
exportclassGridItemCompextendsTmpComp{
115115
privatereadonlywithParamsContext:WithParamsContext={params:{}};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp