Closed danielweinmann closed 8 years ago
The way it is implemented, we will have to have 1 redux action per input widget. I did this because it is what I need in my project.
But it would be easy to implement 1 redux action for the whole form using onValidation prop on GiftedForm instead of onValue ;)
Hi, I don't have so much experience with Redux/Flux so I trust you with that. We may have a conflict for the "value" prop, as it's also used in OptionWidget and HiddenWidget (and maybe another?)
What about a different name?
Let me take a closer look ;)
@FaridSafi, from what I could test and understand:
I removed onValue prop from WidgetMixin and added onValueChange to ContainerMixin, so we can manage all changes in the same place.
I added instructions and example to the README and asked for PR's :) what do you say?
Hello, amazing work @danielweinmann ! I have few questions before publishing
Also I think I will remove soon DayPickerWidget from the library since a crossplatform datepicker is coming in react-native core
Thanks, @FaridSafi!
But for the last few days I've been thinking that everything would be simpler if we didn't try to manage state at all, and GiftedForm was a presentational-only set of widgets. They would receive their values, error messages, etc, from props, inform changes in the values through form's onValueChange and that's it.
The whole state management, validation, etc, logic would be outside of the presentational layer. And then we could choose between using react's default state management, together with validator.js or not, or Redux Form (http://erikras.github.io/redux-form/#/?_k=mznz7a), or anything else.
It would be a big departure from what we currently have, and I cannot invest the time to do it now, but from an architecture point of view it seems like the way to do it.
What do you think of this line of thinking?
I added support for GroupWidget and published 0.0.5
The whole state management, validation, etc, logic would be outside of the presentational layer. And then we could choose between using react's default state management, together with validator.js or not, or Redux Form (http://erikras.github.io/redux-form/#/?_k=mznz7a), or anything else.
I agree with you, for the next big version I want also to make this component compatible with React for Web
Thank you for your time!
That's great! Thank you for the package and for maintaining it :)
I'll keep contributing whenever I can!
What do you think, @FaridSafi? I believe it is 100% compatible with old usage and ads capability to use it with Redux/Flux.