Using React-Native, I have a custom component that extends from TextInput as follows:
Textbox.js
...
render() {
return (
<TextInput
{...this.props}
style={styles.textBox}/>
);
}
...
MyScene.js (imports TextBox.js)
...
render() {
render(
<View>
<TextBox
rel='MyFirstInput'
returnKeyType={'next'}
onSubmitEditing={(event) => { this.refs.MySecondInput.focus(); }}/>
<TextBox
ref='MySecondInput'/>
</View>
);
}
When I create an application and press further on the keyboard, when I focus on MyFirstInput, I expect it to MySecondInputbe in focus, instead I get an error:
_this2.refs.MySecondInput.focus is not a function
What could be a mistake? Is it related to volume this? Thank.
source
share