I have a <TextInput/> and a <FlatList/>, when I type something into <TextInput/> and then touch one item of FlatList. THE RESULT is the first does not work, the second works. I don't know why.
<TextInput
placeholder='test'
value={this.state.inputText}
onChangeText={(inputText) => this.setState({inputText})}
style={{marginBottom: 20, fontSize: 17, width: 300, textAlign: 'center'}}
/>
<FlatList
data={[{key: 'item 1'}, {key: 'item 2'}]}
renderItem={({item}) =>
<TouchableHighlight onPress={() => console.log('item press')}
underlayColor='#dddddd'>
<View style={{height: 40}}>
<Text style={{fontSize: 16, textAlign: 'center'}}>{item.key}</Text>
</View>
</TouchableHighlight>
}
/>
React Native version: 0.46.1 / 0.47
I have a
<TextInput/>and a<FlatList/>, when I type something into<TextInput/>and then touch one item of FlatList. THE RESULT is the first does not work, the second works. I don't know why.React Native version: 0.46.1 / 0.47