Closed mdpratt closed 2 years ago
It looks like after
arrays are generally not being handled correctly. Defining a guard (eg. after: [{ delay: settings.paginationDelay ?? 100, target: 'pending', cond: 'isPaginationAutomatic' }]
will cause the the TypeGen to fail with the following error messages:
Typescript will fail:
Object literal may only specify known properties, and 'isPaginationAutomatic' does not exist in type 'MachineOptionsGuards<{ ...snip...}>
XState VSCode extension will warn:
isPaginationAutomatic is never used in the machine definition
If the same guard is used in an on
handler for a state, then the warnings go away.
Duplicate of #44
Is the visualization and typegen related to the same flaw? If not, I'd recommend reopening this issue.
Yes, it is - it's a parsing issue
Machines that define an array for the
after
attribute do not correctly rendering the node.Code: https://stately.ai/viz/29788792-45db-4927-9d66-590e9ecbbf65
Expected:
Actual: