Generated by XState Viz: https://xstate.js.org/viz
const stepMachine = Machine(
{
id: "steps",
initial: "step1",
states: {
step1: {
on: {
NEXT: "step2"
}
},
step2: {
initial: 'a',
states: {
a: {
on: { NEXT_FIELD: 'b'}
},
b: {
on: { NEXT_FIELD: 'c'}
},
c: {},
hist: { type: 'history' }
},
on: {
NEXT: "step3",
PREV: "step1"
}
},
step3: {
on: {
PREV: "step2.hist"
}
}
},
on: {
GOTO_STEP1: "step1",
GOTO_STEP2: "step2",
GOTO_STEP3: "step3"
}
}
);