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

New Component to change some form values from an external component not in <Form> #394

Open
tompap opened this issue Dec 10, 2018 · 0 comments

Comments

@tompap
Copy link

tompap commented Dec 10, 2018

Feature Request:

Hello,

Currently we can use Redux with a FormSpy to synchronize the formValues in a Store like ReduxForm.
In other word : initialValues will be set to store values and a formSpy will set the values in the store on each value changed.

The problem of this is that on each value changed the form is reseted, I am not sure it's good for performance.

I was wondering if we can do the following:

  • Use a FormSpy to propagate FormField change to Redux
  • Don't set store values as initialValues
  • Create a component that is connected to the store and put this component (inside )
  • As this component is inside the Form I can have access to "change" function.
  • If someone outside the store want to change a value of the form, use an ACTION to change the store Values
  • On value change, the "custom component" received (connected to the store) is called, and because it's inside can call "Change function" to change the form data.
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

No branches or pull requests

1 participant