@@ -87,7 +87,6 @@ class CompleteFlatList extends Component {
8787 return filteredData ;
8888 }
8989
90- renderEmptyRow = ( ) => < Text style = { styles . noData } > No data available</ Text > ;
9190
9291 render ( ) {
9392 const {
@@ -126,7 +125,7 @@ class CompleteFlatList extends Component {
126125 refreshing = { this . props . isRefreshing }
127126 onRefresh = { this . props . pullToRefreshCallback }
128127
129- // onRefresh={this.onRefresh.bind(this)}
128+ // onRefresh={this.onRefresh.bind(this)}
130129 />
131130 ) ;
132131
@@ -141,9 +140,9 @@ class CompleteFlatList extends Component {
141140 data = { filteredData }
142141 renderItem = { item =>
143142 filteredData . length === 1 &&
144- filteredData [ 0 ] . showEmptyRow !== null &&
145- typeof filteredData [ 0 ] . showEmptyRow !== 'undefined'
146- ? this . renderEmptyRow ( )
143+ filteredData [ 0 ] . showEmptyRow !== null &&
144+ typeof filteredData [ 0 ] . showEmptyRow !== 'undefined'
145+ ? this . props . renderEmptyRow ( )
147146 : renderItem ( item . item )
148147 }
149148 style = { styles . flatList }
@@ -164,6 +163,7 @@ CompleteFlatList.propTypes = {
164163 isRefreshing : PropTypes . bool ,
165164 backgroundStyles : PropTypes . object ,
166165 searchBarBackgroundStyles : PropTypes . object ,
166+ renderEmptyRow : PropTypes . func
167167} ;
168168CompleteFlatList . defaultProps = {
169169 searchKey : [ ] ,
@@ -175,6 +175,8 @@ CompleteFlatList.defaultProps = {
175175 highlightColor : '' ,
176176 backgroundStyles : { } ,
177177 searchBarBackgroundStyles : { } ,
178+ renderEmptyRow : ( ) => < Text style = { styles . noData } > { 'No data available' } </ Text >
179+
178180} ;
179181
180182const styles = StyleSheet . create ( {
0 commit comments