File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -146,10 +146,28 @@ export default class ListItemNB extends NativeBaseComponent {
146146 }
147147
148148 renderChildren ( ) {
149- var newChildren = React . Children . map ( this . props . children , ( child ) => {
150- return React . cloneElement ( child , this . getChildProps ( child ) ) ;
151- } ) ;
152-
149+ if ( ! this . isThumbnail ( ) ) {
150+ var newChildren = React . Children . map ( this . props . children , ( child ) => {
151+ return React . cloneElement ( child , this . getChildProps ( child ) ) ;
152+ } ) ;
153+ }
154+ else {
155+ var newChildren = [ ] ;
156+ if ( ! Array . isArray ( this . props . children ) ) {
157+ newChildren . push ( React . cloneElement ( this . props . children , this . getChildProps ( this . props . children ) ) ) ;
158+ }
159+ else {
160+ var childrenArray = React . Children . toArray ( this . props . children ) ;
161+ newChildren . push ( React . cloneElement ( childrenArray [ 0 ] , this . getChildProps ( childrenArray [ 0 ] ) ) ) ;
162+ newChildren . push ( < View style = { { backgroundColor : '#777' } } >
163+ { childrenArray . slice ( 1 ) . map ( ( child ) => {
164+ return React . cloneElement ( child , this . getChildProps ( child ) ) ;
165+ } ) }
166+ </ View > ) ;
167+ }
168+
169+ }
170+
153171 console . log ( newChildren ) ;
154172
155173 return newChildren ;
You can’t perform that action at this time.
0 commit comments