-
Notifications
You must be signed in to change notification settings - Fork 126
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
method workarounds?
#84
Comments
Looking at issues and PRs from the old repo, I was only able to confirm that the method was removed on purpose, not accidentally. No trace of a reason that I could find. It seems that a sane way to validate would be to only care about values. Do you have an example of a use case that would require the whole component context to be made available to the validation function? |
I guess I was being lazy when writing components and eventually ended up with one generalized component that encapsulated the validation code/messages. It also seemed cleaner to do than it would have been to use validation props. I took a look at the code before it was removed, and I didn't think it was that bad/unclean to have an |
We also miss the old validate() method. We are validating not just based on the value, but also on the props of the current I have done a small demo here: https://github.com/stevenpietzsch/formsy-react/tree/custom_validation
Just start the examples demo and see the result. The idea is to validate not only on the value, but also on the prop Is there any workaround for validating against value + props? |
If anyone wants to outline the spec / API documentation for this feature so that it's easily implementable, we can accept pull requests for it. I see several ways to accomplish this as-is:
Am I missing the complexity? |
Upgrading from 0.19, noticed that the "magical"
validate()
method was removed.Is there any new way to use props/state in validations?
The text was updated successfully, but these errors were encountered: