I use a async func to change my state.validate=true/false every on onChangeText method in a TextInputWidget. That´s work; but my problem is when I need that my validator read the state.validate....always is a prev value than the actual value! I use it for comprobe if a username exists in my BD, but if I need to comprobe if the username 'hello1989' exists, the validator return a correct response only when I type one more character: 'hello1989h' (the hello1989 user exists)....I spend two days and cant reach this....the state.validate is passing delayed to my validator. (Sorry my bad english)
<GiftedForm
formName='newAccountForm' // GiftedForm instances that use the same name will also share the same states
validators={{
username: {
validator: (args) =>{
return this.state.usuarioExiste; //return true or false
},
message: 'User unavailable!'
}]
},
...
...
Is posible manage externally the message from a validator ?....for example, from the onSubmit() of the form...
I use a async func to change my state.validate=true/false every on onChangeText method in a TextInputWidget. That´s work; but my problem is when I need that my validator read the state.validate....always is a prev value than the actual value! I use it for comprobe if a username exists in my BD, but if I need to comprobe if the username 'hello1989' exists, the validator return a correct response only when I type one more character: 'hello1989h' (the hello1989 user exists)....I spend two days and cant reach this....the state.validate is passing delayed to my validator. (Sorry my bad english)
Is posible manage externally the message from a validator ?....for example, from the onSubmit() of the form...