New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
service.children empty when machine starts #795
Comments
Can you try this with |
Still empty: CodeSandbox Something has changed when using the transient state workaround though: The React component (
|
That's probably a "pre-bug" before 4.7 is released, but 4.7 shows actors/services in |
Good catch, I didn't tried that! It's still not working though: step1 is returned as an The
PS: btw, thanks a lot for your work and for looking at this issue! :) |
Looks like this is now fixed in 4.7.x |
Unfortunately the above error above is still happening for me as of today (with |
Came across this issue myself today, here's a sandbox: |
Description
I was looking for a way to use a "main" machine to handle the whole workflow of my React application (each screen of the app has its own machine, invoked by the main one).
My
<App />
component just:service.children
MapNot sure this is the best solution (inputs are welcome!), but I came across something rather unexpected:
Expected Result
service.children
should return current actors/invoked services.Actual Result
service.children
returns an empty Map on start, even if a service is invoked and runs properly.Reproduction
Run the following sample and take a look at the console:
CodeSandbox
Starting by a transient state doesn't change anything, but delaying the first state seems to work (really ugly though).
You can test this by opening
machines/main.js
and changinginitial
state fromstep1
to:step0WithADelay
step0WithATransientState
Additional context
XState 4.6.7
The text was updated successfully, but these errors were encountered: