Closed liutao closed 2 years ago
Thanks for debugging this, ill try to take a look later today!
@liutao I am able to reproduce this, quite an interesting bug! (FYI here is a reproduder https://codesandbox.io/s/focused-voice-hnuni?file=/src/main.ts). I have raised this issue with https://github.com/statelyai/xstate since this might affect multiple packages like @xstate/react
and @xstate/vue
. I just want to confirm with @davidkpiano that this is not a problem with xstate core
. Otherwise I will merge and release a patch as soon as possible!
Just waiting for a response on whether this is a bug that should be fixed with core
before merging. https://github.com/statelyai/xstate/issues/2457
Released 0.2.1
to patch this. Thanks for contributing again! let me know if you need anything else
We attempt to use
useMachine
withActor model
in vue, but I noticed theentry
with print two times. After debug,useInterpret
will print one time, andservice.machine. initialState
will print another time. In the source codespawn
depend on aservice
, but executeservice.machine. initialState
directly,service
will beundefined
now.service.machine
will providethis
first,this.machine.initialState
will get the correctservice
.