File tree 1 file changed +16
-28
lines changed
client/packages/lowcoder/src/comps/generators
1 file changed +16
-28
lines changed Original file line number Diff line number Diff line change @@ -384,14 +384,18 @@ const UIView = React.memo((props: {
384
384
] ) ;
385
385
386
386
// render condition for modal and drawer as we are not getting compType here
387
-
388
- const uiCompRender = useMemo ( ( ) => props . viewFn ( childrenProps , comp . dispatch ) , [
389
- childrenProps ,
390
- comp . dispatch
391
- ] ) ;
392
-
393
- const uiCompRenderWithWrapper = useMemo ( ( ) => {
387
+ if ( comp . children . hasOwnProperty ( 'showMask' ) && comp . children . hasOwnProperty ( 'maskClosable' ) ) {
394
388
return (
389
+ < HidableView hidden = { childrenProps . hidden as boolean } >
390
+ { props . viewFn (
391
+ childrenProps ,
392
+ comp . dispatch
393
+ ) }
394
+ </ HidableView >
395
+ ) ;
396
+ }
397
+
398
+ return (
395
399
< div
396
400
ref = { props . innerRef }
397
401
className = { childrenProps . className as string }
@@ -400,30 +404,14 @@ const UIView = React.memo((props: {
400
404
width : '100%' ,
401
405
height : '100%' ,
402
406
margin : '0px' ,
403
- padding : getPadding ( )
407
+ padding : getPadding ( ) ,
404
408
} }
405
409
>
406
- { uiCompRender }
410
+ < HidableView hidden = { childrenProps . hidden as boolean } >
411
+ { props . viewFn ( childrenProps , comp . dispatch ) }
412
+ </ HidableView >
407
413
</ div >
408
- ) } , [
409
- uiCompRender ,
410
- props . innerRef ,
411
- childrenProps . className ,
412
- childrenProps . dataTestId ,
413
- getPadding ,
414
- ] ) ;
415
-
416
- const renderView = useMemo ( ( ) => {
417
- if (
418
- comp . children . hasOwnProperty ( 'showMask' )
419
- && comp . children . hasOwnProperty ( 'maskClosable' )
420
- ) {
421
- return uiCompRender ;
422
- }
423
- return uiCompRenderWithWrapper ;
424
- } , [ comp . children ] ) ;
425
-
426
- return renderView ;
414
+ ) ;
427
415
} , ( prevProps , nextProps ) => {
428
416
return isEqual ( prevProps , nextProps ) ;
429
417
} ) ;
You can’t perform that action at this time.
0 commit comments