4
votes

I have a react form component class containing two redux-form Fields. The form component is wrapped by reduxForm and a container component defining mapStateToProps, mapDispatchToProps functions. Each field is passed an onChange function defined in the form component.

I tried creating a selector on the form using formValueSelector, but the selected values don't update as the field values change.

How can I get the current state.form value of the other field in a onChange function?

I'm using:
"react": "^15.5.4",
"redux-form": "^6.8.0",

1

1 Answers

5
votes

Since redux-form questions tend to go unanswered at stackoverflow, I raised a redux-form issue: https://github.com/erikras/redux-form/issues/3110#issuecomment-312135987

This resulted in a couple of runnable examples of how to retrieve the current state.form value of a Field. Once you have that, you can pass it to an onChange function.