vincentbollaert
10/17/2017 - 3:19 PM

Redux form

Form level onChange that isn't a state change behind

// CONTAINER
handleChange(formfields) {
  console.log('formfields', formfields);
},

// PARENT COMPONENT - pass handleChange to form
<AccountsRF
  handleChange={handleChange}
/>

// FORM COMPONENT - submit on change. handleSubmit is redux-form's internal submit method that passes formfields - pass that to handleChange
<form onChange={() => setTimeout(handleSubmit(formfields => handleChange(formfields)))}>

// notes
// submit calls touchAll, so you'd have to display errors if dirty