我正在使用这个组件:该组件使用的是FlatList,因此我可以在其中使用从FlatList派生的方法,例如onEndReached:
import BottomCarousel from 'react-native-snap-carousel';
<BottomCarousel
onEndReached={loadMore} // << This gives a TS error
...
但是,该库并没有扩展这些方法的typescript定义,因此我得到了一个错误Property 'onEndReached' does not exi
我尝试使用WebView从react本机- webview,所以当我按下按钮(renderItem函数),它将打开一个由api提供的链接,但我试图使用的网页视图,从图像出现的错误。
import React, { Component } from 'react';
import api from '../services/api';
import { View, Text, FlatList, TouchableOpacity, StyleSheet } from 'react-native';
export default class M
我有一个平面表,其中显示卡片和信息,我必须应用分页,即在一开始只有3张卡应该加载到达结束时,更多的3张卡应该加载。
下面是我的代码:
<FlatList
style={{ height: HEIGHT, flex: 1 }} // declared a HEIGHT const with value of windows height
data={this.state.show_data_list} // data to be shown in flatlist
keyExtractor={(x, i) => x + i}
我想在FlatList中渲染一个页脚,但遇到了一些奇怪的问题:
constructor(props) {
super(props);
// bind this for these 4 functions, cause FlatList footer can not be render
this._renderFooter=this._renderFooter.bind(this)
this._onEndReached=this._onEndReached.bind(this)
this._separator = this._separator.bind