xstate
xstate copied to clipboard
Bug: App will crash if sending DOM ref to machine and using inspect
Description
Sending event with DOM ref as data will crash the app entirely, but only happened if you're using @xstate/inspect
.
Expected result
Don't crash
Actual result
crash the entire app. the error message is from React.
TypeError
Cannot set properties of undefined (setting 'pendingProps')
Reproduction
https://codesandbox.io/s/beautiful-dhawan-85g5so?file=/src/index.js:927-931
Clicking click me
button will crash the app, the errorr message from React will show up.
Additional context
No response
You are using some old versions of our libraries in this codesandbox. I've upgraded it and added a custom serialize
option to the inspect
call that makes it possible to handle DOM nodes:
https://codesandbox.io/s/gracious-mendeleev-9uyz61?file=/src/index.js