#Why isn't this action updating my array?

1 messages · Page 1 of 1 (latest)

river ravine
#

Is this state set up properly? It seems to trigger the action but I can't get it to actually update the relevant array in context.

          entry: ["promptAttack"],
          on: {
            ATTACK: {
              actions: ["addCardToPlayingField"],
            },
          },
        },

promptAttack works

          return {
            ...context,
            playingField: [...context.playingField, event.card],
          };
        },

I can see this action being triggered, it has context and the right event. But playingField is never updated.

Any ideas on how to troubleshoot?

#

Why isn't this action updating my array?

karmic ibex