Why isn't this child machine receiving an event? #1833
-
Here's a sandbox. I don't understand why the coundownMachine doesn't receive the INCREASE_TIME event. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You have a bug in your schema. Instead of this: INCREASE_TIME: assign<Context, any>({ /* ... */ }) you should declare this: INCREASE_TIME: {
actions: assign<Context, any>({ /* ... */ })
} Could you report this as an issue? I believe we could do a better job at surfacing this kind of problems to users. |
Beta Was this translation helpful? Give feedback.
-
TypeScript kinda did catch the problem, but it's obviously less clear from that message what's wrong. I would highly recommend you to have a look at https://github.com/mattpocock/xstate-codegen that heavily improves typescript experiences with machines. The first benefit is that you don't to manually sync the |
Beta Was this translation helpful? Give feedback.
You have a bug in your schema. Instead of this:
you should declare this:
Could you report this as an issue? I believe we could do a better job at surfacing this kind of problems to users.