title: React Beautiful DND & Redux: Using a single Redux store, but still reorder cards between lists?
body: <p>I'm building what is essentially a Trello clone using React and Redux. Thanks to @Sagiv b.g, I've got logic in place to allow users to create multiple <code>&lt;Board/&gt;</code>, <code>&lt;List/&gt;</code> and <code>&lt;Card/&gt;</code> instances using a single Redux store. </p>
  
  <p>But that logic breaks down when I want to move <code>&lt;Card/&gt;</code> components between different <code>&lt;List/&gt;</code>. </p>
  
  <p><strong>Example</strong></p>
  
  <p>If I create two lists, one called "To Do" and one called "Done", my Redux logic matches the separate React <code>&lt;List/&gt;</code> component instances to the correct <code>&lt;Board/&gt;</code> instance using my <code>boards()</code> reducer like so:</p>
  
  <pre><code>case ADD_LIST:
    return state.map(board =&gt; {
      if (board.id !== action.boardId) return board;
      return {
        ...board,
        lists: lists(board.lists, action)
      };
    });
  </code></pre>
  
  <p>If I then create a card in my "To Do" list called "Finish Kanban project", the logic is basically the same in Redux for matching the correct <code>&lt;Card/&gt;</code> instance to the correct <code>&lt;List/&gt;</code> instance, except it happens in the <code>lists()</code> reducer:</p>
  
  <pre><code>case ADD_CARD:
    return state.map(list =&gt; {
      if (list.listId !== action.listId) return list;
      return {
        ...list,
        cards: cards(list.cards, action)
      };
    });
  </code></pre>
  
  <p>So far so good! But if I want to <em><strong>move</strong></em> the card I just created from the "To Do" list to the "Done" list, I can't quite figure out the logic with React Beautiful DND and Redux combined.</p>
  
  <p>React Beautiful DND wants to reorder the <strong>entire</strong> array, which means I need to update my array of cards in Redux accordingly. So I'm stuck on how to take a card out of one list and move it to another list using my current Redux logic. </p>
  
  <p>Thanks for any direction. I'm ready to abandon Redux or React Beautiful DND altogether, but wanted to see if anyone has any ideas on how to make it work.</p>