-
Notifications
You must be signed in to change notification settings - Fork 251
Reset for the LocalForm #560
Comments
Thinking about an API for this... The tricky part is that we need to have a declarative approach for this, not an imperative one. "Reaching inside" a component to do something imperatively is definitely an anti-pattern, so I don't want to attach ad-hoc instance methods or anything silly like that. How about something like this? <LocalForm getDispatch={(dispatch) => this.formDispatch = dispatch}>
// ...
</LocalForm> where Then, in your parent component, you can just call: handleReset() {
this.formDispatch(actions.reset('local')); // or whatever model you gave to <LocalForm>
} Does this sound like a good solution? N.B. The reason I'm okay with this approach is, if we think about this in a functional reactive sense, a |
I'd be happy with just |
In the short term, I can actually see |
Actually, I'm going to go forward with
|
Is there any example for resetting the localform within code (programatically) ? |
Just met a scenario where I need to clear LocalForm after submit. How do I do it?
The text was updated successfully, but these errors were encountered: