Hello, i have a parent machine that manages a stepper in UI, this machine will spawn a child machine on every step (state)
i store in the parent machine context some global vars and i would like to pass those values to the invoked child:
Here in parent machine definition i tried using the data property and it works but it overwrite the child machine context
step1: {
invoke: {
id: 'step1',
src: 'step1',
data: (parentcontext) => parentcontext,
},
............
services: {
// passing react hooks to implement child machine configs
step1: step1Machine.withConfig(step1Options(intl, addSnackbar)),
................
How can i pass the parent machine context (or some props) without overwriting the child machine context?
Is there a way to merge the two contexts?
Thanks in advance!