inputBinder | Function | inputBinder( key:string ) | Which includes almost everything of TextInput : value , onChangeText , onBlur , ref , onSubmitEditing also valid & touched if you are making custom input component with these props | <TextInput {...inputBinder('email')} /> |
onChangeHandler | Function | onChangeHandler( key:string, value:string ) | To set value of the field, call this function with arguments: key - which input field to update. value to that field | <TextInput onChangeText={ (text)=> onHandleChange("email":text) } /> |
onBlurHandler | Function | onBlurHandler( key:string ) | To set which field is blurred, call this function with key on blurrEvent | <TextInput onBlur={ ()=> onBlurHandler("email") } /> |
refsHandler | Function | refsHandler( key:string, ref:any ) | To set which field is blurred, call this function with key on blurrEvent | <TextInput ref={ (ref)=> refsHandler("email",ref) } /> |
onSubmitEditingHandler | Function | onSubmitEditingHandler( key:string ) | To set which field is blurred, call this function with key on blurrEvent | <TextInput onSubmitEditing={ ()=> onSubmitEditingHandler("email") } /> |
onSubmitHandler | Function | onSubmitHandler( callback:(values)=>{} ) | This handle submit button & validation flow. This is used to submit form. | <Button title="Submit" onPress={ ()=> onSubmitHandler( (values)=> submitFormToApi(values) ) } /> |
values | { [key:string]:string, ... } | values={ values[key] } | Objct of field values, can be used for value input for the TextInput | <TextInput value={values.email} /> |
valid | { [key:string]:boolean, ... } | | Its is This object contains validation results,true :valid and false :validation fail. | {!valid.email && <Text> This fields is invalid </Text>} |
touched | { [key:string]:boolean, ... } | | Its is used to show error message on validation fail. | {touched.email && !valid.email && <Text> This fields is invalid </Text>} |