Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

actions: must be an array #87

Open
johnnydecimal opened this issue Jun 19, 2021 · 0 comments
Open

actions: must be an array #87

johnnydecimal opened this issue Jun 19, 2021 · 0 comments

Comments

@johnnydecimal
Copy link
Contributor

When defining actions on a transition, if a single inline action is defined – as per the example in the XState documentation – the type definitions cause an error. Wrapping the action in an array works as expected.

// Fails
on: {
  actions: (context, event) => console.log('Fails!');
}

// Works
on: {
  actions: [
    (context, event) => console.log('Works!');
  ]
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant