final-form / final-form/react-final-form

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

Open
#394 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.