validate nested this.state
This version has added iteration for looking into the children of this.state, so that we can validate nested this.state.
For example, say we have:
this.state={ data:{ email:'' } }
In terms of the usage:
this.validate({ data:{ email: { email: true, required: true } } })
For rendering error, we could use "data.email":
{this.isFieldInError('data.email') && this.getErrorsInField('data.email').map(errorMessage => <Text>{errorMessage}</Text>) }
@perscrew is it worth using above PR ? If Yes Please merge it
@perscrew is it worth using above PR ? If Yes Please merge it
This library has been completely rewritten in typescript. I prefer to work on https://github.com/perscrew/react-simple-form-validator and start a new PR.