Open BenjaminBrossi opened 3 years ago
I know this issue is stale but I ran into this just now and maybe it helps the next person. It seems as a workaround you can explicitly pass a pass-through context fn as the last argument to createMachine because it otherwise defaults to () => {}
.
const quizMachine = createMachine('loading', states, (initialContext) => initialContext);
const [current, send] = useMachine(quizMachine, { ...defaultContext(), quizId, language });
Likely a bug and not by design but I'm still wrapping my head around the code.
Seems like i cant provide an inital context with the useMachine-hook: