File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change 22'use strict' ;
33
44import React from 'react' ;
5- import { View } from 'react-native' ;
5+ import { View , ListView } from 'react-native' ;
66import NativeBaseComponent from '../Base/NativeBaseComponent' ;
77import computeProps from '../../Utils/computeProps' ;
88import _ from 'lodash' ;
@@ -52,10 +52,21 @@ export default class ListNB extends NativeBaseComponent {
5252 }
5353
5454 render ( ) {
55- return (
56- < View { ...this . prepareRootProps ( ) } >
57- { this . renderChildren ( ) }
58- </ View >
59- ) ;
55+ if ( this . props . dataArray && this . props . renderRow ) {
56+ const ds = new ListView . DataSource ( { rowHasChanged : ( r1 , r2 ) => r1 !== r2 } ) ;
57+ var dataSource = ds . cloneWithRows ( this . props . dataArray ) ;
58+ return (
59+ < ListView { ...this . prepareRootProps ( ) }
60+ enableEmptySections = { true }
61+ dataSource = { dataSource }
62+ renderRow = { this . props . renderRow } />
63+ ) ;
64+ }
65+ else
66+ return (
67+ < View { ...this . prepareRootProps ( ) } >
68+ { this . renderChildren ( ) }
69+ </ View >
70+ ) ;
6071 }
6172}
You can’t perform that action at this time.
0 commit comments