How to pass spawn
ed machine refs to @xstate/react's useActor
?
#5142
Unanswered
cmh-echomark
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been following the
spawn
docs here with the@xstate/react
useActor docs and I noticed a lot of "Coming soon" placeholder text. Is this not supported?I have several nested/child machines in my xstate v4 that use the old
spawn
method along withuseActor
.Sample code
Here is a codesandbox example here that I cannot get to function.
Parent machine:
Child machine
Parent React component
Child React component
Am I doing it wrong? Or is this not yet supported in xstate v5?
I have tried combinations of
useActorRef
,useMachine
,useSelector
- all have limitations and/or cannot communicate between child/parent as I expect (based on what was available in v4).Beta Was this translation helpful? Give feedback.
All reactions