在反应中,未在FlatList

时间:2017-12-15 10:40:09

标签: android windows react-native react-native-flatlist

我正在使用反应原生FlatList Component。这个onEndReached触发器没有被触发....

<FlatList
 data={this.state.data}
 keyExtractor={(x, i) => i}
 onEndReached={() => {console.log('fetch more')}}
 onEndReachedThreshold={0.5}
 refreshing={false}
/> 

React Native版本:0.44.0 平台:Android 操作系统:windows 10

确切代码:

<FlatList 
  data={this.props.product} 
  renderItem={({ item }) => 
     ( <ListItem roundAvatar title={${item.name}} avatar=
        {{uri:'item.img_name'}} containerStyle={{ borderBottomWidth: 0 }} 
     />)
   } 
  keyExtractor={item => item.id} 
  ItemSeparatorComponent={this.renderSeparator} 
  ListHeaderComponent={this.renderHeader} 
  ListFooterComponent={this.renderFooter} 
  refreshing={this.state.refreshing} 
  initialNumToRender={10}
  onRefresh={this.handleMore}
  onEndReachedThreshold={0.3}
  onEndReached={() => this.handleMore()} 
/>

In this code if we put alert in onEndReached trigger then this done three 
times.Alert show three times but if we call handleMore() Method in 
onEndReached Trigger then this is not working method is not call . Please 
Help for solving this issue .Thank you

0 个答案:

没有答案