I am using Redux Form (RF) in a React Native application. Everything works fine, but I canβt figure out how to get Fieldrefs from input to go to the next input field using the Redux form.
Without RF, this solution will work fine.
Here is my code:
class RenderInput extends Component {
const { input, nextField, refs,
meta: { touched, error, warning },
input: { onChange } } = this.props
render() {
return (
<Input
returnKeyType = {'next'}
onChangeText={onChange}
onBlur={input.onBlur}
onFocus={input.onFocus}
onSubmitEditing = {(event) => {
refs[nextField].focus()
}}/>
)
}
}
class Form extends Component {
render() {
return (
<Field
name="field1"
focus
withRef
ref='field1'
nextField = "field2"
component={RenderInput}/>
<Field
name="vendor"
withRef
ref="field2"
nextAction = "field3"
component={RenderInput}/>
)
}
}
I pass a property to the nextFieldcomponent to determine the next input field when a key is pressed Nexton the keyboard, but I cannot get the property refsinside the component RenderInput.
Any idea how to get property refs ?