3

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}
/>

1 Answer 1

3

The correct prop is onChangeText. Not onChangedText

Sign up to request clarification or add additional context in comments.

1 Comment

shoot me. its time to take a break from coding today

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.