How we can access values from dynamically created Text Input. Like flat list creates 3 text inputs and then on click of button we validate which one is added and which one not. How to manage multiple state array. currently I done this
const data = [1,2];
constructor(props) {
super(props);
this.state = {
Textdata:[],
};
}
SubmitButton(){
//how to access those text input values and add to array
}
<FlatList
data={data}
renderItem={this.renderItem}
keyExtractor={(item, index) => item}
/>
renderItem = ({ item, index }) => {
return (
<View>
<Item
floatingLabel
style={styles.InputBoxStyle}
>
<Label>First Name</Label>
<Input
/>
</Item>
<Item
floatingLabel
style={styles.InputBoxStyle}>
<Label>Last Name</Label>
<Input
/>
</Item>
<Button rounded
onPress={this.SubmitButton}>
<Text>Submit</Text>
</Button>
</View>
);
};