Reputation: 634
Well this is an embarrassing question, but I can't get this TextInput to take values I type into it.
It just deletes it as fast as I can type it - and I'm pretty sure logging this.state.code shows an empty variable.
Is it the keyboard type messing with me? Do I need to do a .toString()
?
constructor() {
super()
this.state = {
code: '12'
}
}
<TextInput
onChangedText={(text) => this.setState({code: text})}
value={this.state.code}
keyboardType='numeric'
style={styles.input}
placeholder='Code'
maxLength={4}
/>
Upvotes: 3
Views: 1502