Skip to content

Nested react components? #1499

Answered by Andarist
rajansaini691 asked this question in General
Discussion options

You must be logged in to vote

Use useMachine to start B'. My issue is that it spins up a new service but does not give it a parent. This causes sendParent to crash when I try to get B' to talk to A'.

To make this work you could pass the parent service to the inner component (as a prop or whatever) and just use things like send(event, { to: parent }). Don't treat this situation as a parent-child situation but rather just 2 separate machines that happen to know each other "addresses" (well, to get "child"'s address in the "parent" you would have to greet it with an event in this situation).

Invoke B' when A' enters S. This lets sendParent work, but I'm not sure how to connect the running service B' to component B (so…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rajansaini691
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants