我想在功能组件上使用returnKeyType移至下一个输入字段。
H如何做到这一点?
returnKeyType="none"
没有ref函数无法正常工作,而且我无法在无状态组件上使用ref。
<Input
value={this.state.username}
onChangeText={username => this.setState({username})}
autoCorrect={false}
placeholderTextColor="#fff"
placeholder="Username or Email"
returnKeyType={"next"}
onSubmitEditing = {
() => this.secondTextInput.focus()
}
/>
<Input
value={this.state.password}
onChangeText={password => this.setState({password})}
placeholderTextColor = "#fff"
placeholder="Password"
secureTextEntry
returnKeyType ="done"
forwardRef={input => {
this.secondTextInput = input;
}}/>