Skip to content
This repository was archived by the owner on Nov 29, 2017. It is now read-only.

Changing data on card #11

@gummie4444

Description

@gummie4444

If you would write a new reducer that would change the card

EXAMPLE:

    case CHANGE_CARD: {
      const newLists = [...state.lists];
      // First card in first row
      newLists[0].cards[0].title = "test";

      return state.withMutations((ctx) => {
        ctx.set('lists', newLists);
      });

This results in

  • The state updates
  • Board re-render with new props
  • CardsContainer re-render with new props
  • Cards re-render with new props

But here is the error, when debugging the code in the Render function in Cards, the CardList array is updated and if you look at the CardList data the props have the new title as "test" BUT DraggableCard does NOT re-render.

But as soon as you move the card by dragging, then the re-render of DraggableCard works and the correct title "test" is rendered.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions