When I use redux-form
v7, I find there is no way to set the field value. Now in my form
, I have two select
component. The second\'s va
You can have the onChange logic in this.handleSelectChange({ value, type: input.name })
and use change action from redux-form
According to the docs:
change(field:String, value:any) : Function
Changes the value of a field in the Redux store. This is a bound action creator, so it returns nothing.
Code:
handleSelectChange = (value, type) => {
if(type === "site") {
this.props.change('net', "newValue");
}
}
const mapDispatchToProps = (dispatch) => {
return bindActionCreators({change}, dispatch);
}