title: How to push redux-form input value to array?
body: <p>I am creating a redux-form Wizard Form that collects several input values of the same type that should be stored in redux as an array. For context, the form is collecting a Number value representing the amount of weight lifted on each of several sets (typically 3 to 5 sets). For each exercise type, there should be an array stored, e.g.:</p>
  
  <pre><code>form: {
    workout: {
      values: {
        deadlifts: [150, 160, 170, 180],
        bench-press: [135, 155, 175],
        etc ...
      }
    }
  }
  </code></pre>
  
  <p>My issue is that submitting a value merely overwrites the previous value. I am not sure how to (1) initialize redux store values as arrays, and/or (2) push new values to those arrays.</p>
  
  <p>Each exercise has a Wizard Form. The Wizard Form is made up of several WorkoutForm components. The Wizard Form passes relevant information regarding exercise name, number of sets, etc., to the WorkForms with <code>currentExercise</code>. <code>setIndex</code> is from the Wizard Form component's state and tracks the curret set.</p>
  
  <p>WorkoutForm</p>
  
  <pre><code>const WorkoutForm = ({ currentExercise, setIndex, handleSubmit }) =&gt; {
  
    return (
      &lt;form onSubmit={handleSubmit}&gt;
        &lt;Field 
          name={currentExercise.name} 
          type="number" 
          placeholder={`enter ${currentExercise.track}`} 
          component={renderField} 
          label="exercise" /&gt;
        &lt;div&gt;
          &lt;button type="submit" className="next"&gt;Submit&lt;/button&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    ) 
  }
  
  WorkoutForm.propTypes = {
    handleSubmit: PropTypes.func.isRequired,
    currentExercise: PropTypes.shape({
      name: PropTypes.string.isRequired, // such as 'deadlift'
      reps: PropTypes.array.isRequired, // reps for each set, such as [10,8,6,4]
      track: PropTypes.string.isRequired, // either 'weight' or 'reps'
    }).isRequired,
  };
  
  export default reduxForm({
    form: 'workout',              // &lt;------ same form name
    destroyOnUnmount: false,     // &lt;------ preserve form data
    validate
  })(WorkoutForm)
  </code></pre>
  
  <p>RenderField</p>
  
  <pre><code>const renderField = ({ input, label, type, placeholder, meta: { touched, error } }) =&gt; (
    &lt;div&gt;
      &lt;label&gt;{label}&lt;/label&gt;
      &lt;div&gt;
        &lt;input {...input} placeholder={placeholder} type={type} /&gt;
        {touched &amp;&amp; error &amp;&amp; &lt;span&gt;{error}&lt;/span&gt;}
      &lt;/div&gt;
    &lt;/div&gt;
  )
  
  export default renderField
  </code></pre>