I have redux form having dropdown and text fields. On dropdown change i have to update the other fields. The other fields are using custom component example
So the structure is like. 1. component having form 2. Field component.
Now i googled and found few things to update the field but not able to do it. What i tried 1. Adding state in the field like below in value. Does not work.
<Field name="accountno" value="this.state.accountno" component={InputText} placeholder="Number" />
Tried disptach but not able to use it. Getting error for no dispatch i prop type
this.props.dispatch(change('form', 'accountno', 'test value'));
Tried this.props.fields but same not fields in props type.
It should work using 2 or 3 but not able to find where to add those. Please let me know how can i use these or any other way.
onChange
as a property ofinput
withPropTypes.shape
. – Julio Bettaredux-form
methods and props (onChange
,disabled
, etc...) in your custom input component, unless they are required. But answering your question, take a look at this article andrewhfarmer.com/validate-nested-proptypes. It shows how to use the proptypeshape
. – Julio Betta