我如何将它与 FlatList 一起使用而不是与 ListView 一起使用?

How can I use this with FlatList not with ListView?

我从 react-native-gifted-chat 中获取了这段代码 我想使用 FlatList

<ListView
      enableEmptySections={true}
      automaticallyAdjustContentInsets={false}
      initialListSize={20}
      pageSize={20}

      {...this.props.listViewProps}

      dataSource={this.state.dataSource}

      renderRow={this.renderRow}
      renderHeader={this.renderFooter}
      renderFooter={this.renderLoadEarlier}
      renderScrollComponent={this.renderScrollComponent}
    />

下面是一个使用 FlatList 来完成您想要做的事情的示例:

 render() {
    return (
      <View style={{ flex: 1 }}>
        <FlatList
          data={someArrayWithDataObjects} // your data source
          renderItem={({ item }) => this.renderSearchResults(item)} // how you want each item rendered
          keyExtractor={item => item.id} // unique identifier for performance reasons
        />
      </View>
    );
  }