I'm having a bit of an issue resetting my TextInputs after submitting because they were added dynamically.
I currently have my js code like this
<FlatList
data={this.state.items}
keyExtractor={(item, index) => item.party_id}
renderItem={({item}) =>
<View style={styles.InputBox}>
<TouchableOpacity style={styles.InputPartyLabel}><Text>{item.party_name}</Text></TouchableOpacity>
<TextInput
ref={input => { this.textInput = input }}
style={styles.Input}
placeholder="Number of votes"
onChangeText={result => this.collateResults(item.party_name, result)}
placeholderTextColor="#bbb"
autoCapitalize='none'
underlineColorAndroid='transparent'
/>
</View> } />
I added this ref={input => { this.textInput = input }} but it only clears the last one.
You need this.textInput to be an array. And then push to that array when setting the refs
<TextInput
ref={input => this.textInput.push(input)}
style={styles.Input}
placeholder="Number of votes"
onChangeText={result => this.collateResults(item.party_name, result)}
placeholderTextColor="#bbb"
autoCapitalize='none'
underlineColorAndroid='transparent'
/>