I am getting an count from user selection - for example when user selects 5 means i will be getting
const count = 5;
And by keeping this, am dynamically creating textInput using for loop, and its working perfectly ! but how to store the values in state when user type ? I could not understand how to perform this action ! I have tried this , but it gives error saying value should not contain array as input,
state = { userDetails: [] }
textHandler(texts){
this.setState({...this.state.userDetails, texts})
}
for (let i = 0; i < count; i++) {
items.push(
<TextInput
style={{ borderBottomWidth: 1, borderColor: '#f0eff4', height: 40 }}
placeholder="Enter Name"
onChangeText={text => this.textHandler(text)}
value={this.state.userDetails}
/> ) }
count?