File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -11,21 +11,16 @@ const LazyRenderBox = React.createClass({
11
11
return nextProps . hiddenClassName || nextProps . visible ;
12
12
} ,
13
13
render ( ) {
14
- if ( this . props . hiddenClassName ) {
15
- const props = { ... this . props } ;
16
- let className = props . className ;
17
- if ( ! props . visible ) {
18
- className += ` ${ props . hiddenClassName } ` ;
14
+ const { hiddenClassName , visible , ... props } = this . props ;
15
+
16
+ if ( hiddenClassName || React . Children . count ( props . children ) > 1 ) {
17
+ if ( ! visible ) {
18
+ props . className += ` ${ hiddenClassName } ` ;
19
19
}
20
- props . className = className ;
21
- delete props . hiddenClassName ;
22
- delete props . visible ;
23
20
return < div { ...props } /> ;
24
21
}
25
- if ( React . Children . count ( this . props . children ) > 1 ) {
26
- return < div { ...this . props } /> ;
27
- }
28
- return React . Children . only ( this . props . children ) ;
22
+
23
+ return React . Children . only ( props . children ) ;
29
24
} ,
30
25
} ) ;
31
26
You can’t perform that action at this time.
0 commit comments