title: add property to object in state array with useReducer
body: <p>I have an array of objects stored in state that looks like:</p>
  <pre><code>    {
          &quot;file&quot;: {},
          &quot;myFsize&quot;: 1321,
          &quot;fileType&quot;: &quot;image/jpeg&quot;
      },
  {
          &quot;file&quot;: {},
          &quot;myFsize&quot;: 999,
          &quot;fileType&quot;: &quot;image/jpeg&quot;
      }
  ]
  </code></pre>
  <p>I am using <code>useHookReducer</code> to add and remove objects successfully</p>
  <p><code>const [fileSelectedArrax, setfileSelectedArrax] = useReducer(fileSelectReducer, [])</code></p>
  <p>however I want to also add an upload progress to each object as it uploads. It shhould look like this...</p>
  <pre><code>    {
          &quot;file&quot;: {},
          &quot;myFsize&quot;: 1321,
          &quot;fileType&quot;: &quot;image/jpeg&quot;,
          &quot;percent&quot;: &quot;90&quot;
      },
  {
          &quot;file&quot;: {},
          &quot;myFsize&quot;: 999,
          &quot;fileType&quot;: &quot;image/jpeg&quot;,
          &quot;percent&quot;: &quot;100&quot;
  
      }
  ]
  </code></pre>
  <p>This is my reducer:</p>
  <pre><code>function fileSelectReducer(state, action) {
     switch (action.type) {
        case 'add':
           console.log(state)
           return [...state, action.filex]
        case 'adduploadprogress':
           //WHAT HERE?
          return [...state]
        case 'remove':
           const update = [...state]
           update.splice(update.indexOf(action.file), 1)
           document.getElementById(fileattach).value = ''
           return update
        default:
           return state
      }
  }
  </code></pre>
  <p>My function to invoke this is:</p>
  <pre><code>function adduploadprogress({ file, percent }) {
     const filex = { file, percent }
     console.log(filex)
     setfileSelectedArrax({ filex, type: 'adduploadprogress' })
  }
  </code></pre>
  <p>I have tried <code>for loops</code> and ternerys to match the object in state to the file being passed in in the action, but nothing seems to work</p>