Closed ivan-kleshnin closed 9 years ago
Great. Will be a nice enhancement. I'm about to cut a 4.0.0 major release of this library. I'll get this PR merged up to master and go over the changes. I'm excited about this one!
Any updates on this? I'm trying to use the mixin to validate one object in my state with several of its own properties.
@ntdb I need to revisit this. I think there may be a simpler way to handle this validation case, but need to prototype it before I'm sure. If that doesn't workout I'll begin on moving this into master.
@ntdb mixins are no longer supported, so it's probably worthless to go in that direction too far. You have two ways: 1) make Form component and extend it 2) implement some helper-like toolkit of functions an use them manually
Branches have diverged to use this PR. I will be adding support for deep nested object validation in the near future. See #25 for an interim solution.
With compound keys like
model.username
resulting validation messages may be represented in two styles:Previous attempt at (https://github.com/jurassix/react-validation-mixin/pull/12) is working but implementation is really complex. All lens libraries I analized are borked. To not create another one, I decided to abandon previous approach and implemented new one where errors object is kept flat. It turned out to be much cleaner.
Now code & tests are ready for review :)