You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm in need of passing a machine config to invoked machine. Namely I want to restore snapshot to the last shape on navigating back to it, I'm able to navigate out without finalizing via #id nav as well as I can store invoked machine state in parent machine context, but I can't find a way how to pass init params to machine being invoked. Is there any...?
As alternative I can think of adding initial state in child machine that will take snapshot from input and restore it via self reference. But a way to pass it directly on parent would be cleaner IMO.
I found that in v4 this was quite straight-forward: as invoke.src was a factory function: invoke.src = (context) => machine;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm in need of passing a machine config to invoked machine. Namely I want to restore snapshot to the last shape on navigating back to it, I'm able to navigate out without finalizing via #id nav as well as I can store invoked machine state in parent machine context, but I can't find a way how to pass init params to machine being invoked. Is there any...?
As alternative I can think of adding initial state in child machine that will take snapshot from input and restore it via self reference. But a way to pass it directly on parent would be cleaner IMO.
I found that in v4 this was quite straight-forward: as invoke.src was a factory function:
invoke.src = (context) => machine
;Beta Was this translation helpful? Give feedback.
All reactions