-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
XState version
XState version 5
Description
If I'm starting a state machine from React, and the state machine throws a synchronous error, I'm not able to display it.
I modified the starter StackBlitz example to throw from an action in the submit state: https://stackblitz.com/edit/github-zdh2xswa?file=src%2FApp.tsx,src%2FfeedbackMachine.ts
To repro, press "Bad", then enter some text in the form, then press "Submit".
In the Feedback component, I try to render the value of state.error, but the component never updates.
Expected result
My expectation was that the component would update, and render the error string.
Actual result
The component didn't update after the error was thrown.
Reproduction
https://stackblitz.com/edit/github-zdh2xswa?file=src%2FApp.tsx,src%2FfeedbackMachine.ts
Additional context
No response
Reactions are currently unavailable