Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate nested this.state #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kennicefung
Copy link

@kennicefung kennicefung commented Nov 2, 2019

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>) }

@anshulchauhan70
Copy link

@perscrew is it worth using above PR ?
If Yes Please merge it

@perscrew
Copy link
Owner

perscrew commented Mar 4, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants