title: React/Redux: componentDidUpdate not firing consistently
body: <p>I have nested arrays in my props, and the user can re-order the second-level array by dragging and dropping column. I (using redux) make a shallow copy of getState's outer array, do the re-ordering (through re-assignment of array objects based on index), and return the new array to the state (using spread operator in my reducer). However, <code>componentDidUpdate</code> is not called <strong>if this ordering is the first thing I do after page load</strong>. If I take other actions that update the props/state, <em>and then</em> attempt to re-order, the ordering works fine and <code>componentDidUpdate</code> is called.</p>
  
  <p>In the former situation, where ordering is the first thing I try to do after page load/refresh, the render function is hit (with the properly re-ordered props) but the DOM never updates, presumably because redux does not recognize a state change?</p>
  
  <p>It just seems like some other props change (even if unrelated to arrays) "wakes up" redux or <code>connect</code> and allows it to recognize changes.</p>
  
  <p>Here's where I copy, dispatch and then release the updated state in the reducer:</p>
  
  <p>in actionCreator method:</p>
  
  <pre><code>...
  const newProjects = getState().tracker.projects.slice().map(p =&gt; {
      if (p.innerArray) {
          const from = p.innerArray[draggedId-1];
          const to = p.innerArray[droppedId-1];
          p.innerArray[draggedId - 1] = { ...to, order: draggedId };
          p.innerArray[droppedId - 1] = { ...from, order: droppedId };
      }
      return p;
  })                
  dispatch({ type: 'RECEIVE_FIELD_UPDATE', projects: newProjects, message: "Sorted" });
  </code></pre>
  
  <p>reducer:</p>
  
  <pre><code>case 'RECEIVE_FIELD_UPDATE':
          return {
              ...state,
              projects: action.projects,
              message: action.message
          }
  </code></pre>
  
  <p>As you can see, I'm not mutating state in the reducer or doing other anti-pattern things (as far as I'm aware).</p>
  
  <p>FWIW, the "Sorted" value on message property seems to get through whether or not <code>componentDidUpdate</code> is hit (I have a modal that pops up with the message to confirm).</p>
  
  <p>Any pointers or related documentation would be helpful; I've been reading all I can find, including other StackOverflow posts, but to no avail.</p>
  
  <p><strong>UPDATE</strong>
  Solved the issue, it did have to do with redux not diff-ing the properties but not because of what I expected, read below if interested.</p>