Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

"Send" button is disabled when trying to send an event with custom data #250

@a-uz

Description

@a-uz

I already noticed two other issues (#222, #223) regarding the send button, but this issue seems different.

As mentioned in the title, "Send" button is disabled when trying to send an event with custom data.

image

To reproduce this you may use this machine:

import { createModel } from "xstate/lib/model";

const counterModel = createModel(
  {
    count: 1,
  },
  {
    events: {
      INCREMENT: (by: number) => ({ by }),
    },
  }
);

const counterMachine = counterModel.createMachine({
  id: "counter",
  context: counterModel.initialContext,
  on: {
    INCREMENT: {
      actions: counterModel.assign({
        count: (context, event) => context.count + event.by,
      }),
    },
  },
});

With this event:

{
  "type": "INCREMENT",
  "by": 1
}

Metadata

Metadata

Assignees

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