React native 两个平面列表中的选择数据+;验证-反应本机
我正试图在firestore数据库中保存来自两个平面列表的数据。我必须在每个平面列表中选择一个元素,然后单击按钮将这些数据添加到数据库中React native 两个平面列表中的选择数据+;验证-反应本机,react-native,react-native-flatlist,touchableopacity,react-flatlist,React Native,React Native Flatlist,Touchableopacity,React Flatlist,我正试图在firestore数据库中保存来自两个平面列表的数据。我必须在每个平面列表中选择一个元素,然后单击按钮将这些数据添加到数据库中 <Text>Select the task you want to add to child : </Text> <FlatList data={this.props.tasks.tasks} renderItem={({item},index)=>this.r
<Text>Select the task you want to add to child : </Text>
<FlatList
data={this.props.tasks.tasks}
renderItem={({item},index)=>this.renderItem1(item,index)}
keyExtractor={(item,index)=>index.toString()}
ListEmptyComponent={
<View>
<Text>Not Adding Any Tasks</Text>
</View>
}/>
<Text>Select the child you want to use task : </Text>
<FlatList
data={this.props.emails.emails}
renderItem={({item},index)=>this.renderItem2(item,index)}
keyExtractor={(item,index)=>index.toString()}
ListEmptyComponent={
<View>
<Text>No Children connected to you</Text>
</View>
}/>
<TouchableOpacity onPress={()=>this.MailSelection(item,index)}>
<Text>Save</Text>
</TouchableOpacity>
选择要添加到子任务的任务:
this.renderItem1(项,索引)}
keyExtractor={(项,索引)=>index.toString()}
ListentyComponent={
不添加任何任务
}/>
选择要使用的子任务:
this.renderItem2(项,索引)}
keyExtractor={(项,索引)=>index.toString()}
ListentyComponent={
没有孩子和你有联系
}/>
this.MailSelection(项目、索引)}>
拯救
我如何创建一个函数,将renderItem1和renderItem2两个函数的项作为参数,以便检索每个平面列表中的数据