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

Commit

Permalink
Merge pull request #422 from statelyai/davidkpiano/fix-action-viz-1
Browse files Browse the repository at this point in the history
Fix action viz
  • Loading branch information
davidkpiano authored Aug 4, 2023
2 parents 4c1a97d + a10ff29 commit 65c7d69
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fast-taxis-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'xstate-viz-app': patch
---

Fixes issue where raise actions were causing visualizer to crash
7 changes: 6 additions & 1 deletion src/ActionViz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ export const ActionType: React.FC<{ title?: string }> = ({
export const RaiseActionLabel: React.FC<{
action: PotentiallyStructurallyCloned<RaiseAction<EventObject>>;
}> = ({ action }) => {
const eventType =
typeof action.event === 'object' && action.event !== null
? action.event.type ?? <em>unknown</em>

Check failure on line 69 in src/ActionViz.tsx

View workflow job for this annotation

GitHub Actions / cypress-tests

Property 'type' does not exist on type 'never'.
: `${action.event}`;

return (
<ActionType>
<strong>raise</strong> {action.event}
<strong>raise</strong> {eventType}
</ActionType>
);
};
Expand Down

0 comments on commit 65c7d69

Please sign in to comment.