我想在我的listHeaderComponent中添加一个TextInput,但是当我添加这个时,我得到这个错误:
当我删除textInput,然后我得到没有错误,它的工作原理.
代码:
...
function Header() {
return (
<View style={s.header}>
<Text style={s.headerTitle}>{t('packet.multiple_send_title')}</Text>
<TextInput value={value} onChangeText={(e) => setValue(e)} />
<Button onPress={handleSendMessages} disabled={selectedUsers.length > 0 ? false : true} style={[ButtonStyles.full, s.btnSend]}>
<Text style={s.btnSendText}>{t('packet.multiple_button_send')}</Text>
</Button>
</View>)
}
return (
<Modalize
ref={ref}
modalStyle={{ flexGrow: 1, padding: 8 }}
flatListProps={{
data: newArr(),
style: {
padding: 0,
flexGrow: 1
},
renderItem: renderItem,
ListEmptyComponent: ShowTextWhenArrayIsEmpty,
ListHeaderComponent: Header,
keyExtractor: (item, i) => i.toString(),
showsVerticalScrollIndicator: false,
stickyHeaderIndices: [0],
scrollEventThrottle: 16,
maxToRenderPerBatch: 2,
keyboardShouldPersistTaps: 'handled',
initialNumToRender: 4,
updateCellsBatchingPeriod: 200,
}}
/>
1条答案
按热度按时间jrcvhitl1#
我也遇到了同样的错误,将此添加到app/build.gradle对我有效:
来源:https://github.com/oblador/react-native-keychain/issues/553#issuecomment-1253983687