title: update value inside array object
body: <p>I only want to replace the <code>name</code> with the new name being typed in from the user. I'm using react redux typescript and its proving to be quite difficult. All the passed in arguments work, the <code>newName</code> and <code>index</code>, I just need to update the array object then return it with only the name in the index object changed.</p>
  <p>My code:</p>
  <p>Action:</p>
  <pre><code>export const updateName = (newName: string, index: number) =&gt; (
    dispatch: (arg0: { type?: string; newName: string; index: number }) =&gt; any
  ) =&gt; {
    dispatch({
      type: UPDATE_NAME,
      newName,
      index
    });
  };
  </code></pre>
  <p>Reducer:</p>
  <pre><code>case UPDATE_NAME:
        return {
          ...state
          items[action.index].name: action.newName,
  
        };
  </code></pre>
  <p>State looks like this:</p>
  <pre><code>items: Array(50)
  0: {id: &quot;1d0b1095-f0b4-4881-8d5e-74c86d5beee2&quot;, name: &quot;A Ipsum Debitis&quot;, participants: {…},
  1: {id: &quot;7384a574-1592-484e-9404-e876bf45410c&quot;, name: &quot;Distinctio Blanditiis Voluptatibus Ut&quot;, participants: {…},
  </code></pre>