Skip to content

Best Way To Access invoked Actor from Parent using @xstate/react #4955

Discussion options

You must be logged in to vote

@TheNoodleMoose did you ever figure out a better way? I'm facing the exact same issue with my parent-child wizard machine system.

@with-heart any ideas?

I did figure out a solution but not the way I had originally intended. After writing everything out I did in fact realize that they were two separate machines and did not necessarily need to be 'aware' internally of each others state. So the two machines are completely separate now, and I individually invoke updateCaseMachine for each step in that steps component. I then pass down a function via props that will move caseMachine to it's next state (or the essentially the next step). To listen for when to correctly do this I have the foll…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@TheNoodleMoose
Comment options

@ersinakinci
Comment options

@TheNoodleMoose
Comment options

Answer selected by TheNoodleMoose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants