Skip to content
This repository has been 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

Open
a-uz opened this issue Sep 2, 2021 · 0 comments · May be fixed by #256
Open

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

a-uz opened this issue Sep 2, 2021 · 0 comments · May be fixed by #256
Assignees

Comments

@a-uz
Copy link

a-uz commented Sep 2, 2021

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
}
@farskid farskid self-assigned this Sep 4, 2021
@farskid farskid linked a pull request Sep 8, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants