Closed larsbuch closed 6 years ago
Can I accomplish this with 'react-automata' ?
Hi @larsbuch, you are using changes that have been introduced in xstate 4 (described here. However react-automata depends on xstate 3 which uses a different way to declare history states. See this https://xstate.js.org/docs-v3/#/guides/history. I hope this helps.
Thanks @larsbuch for opening this issue, and @ferdinandsalis for answering the question. Let's use #82 to track the future of this library.
Typically it is desirable to have the possibility to go back to the state that you came from.
This can be handled with at history transition. My problem is that it stays at the history state instead of changing to the previous state
`const initialState = "a";
const statechart = { initial: initialState, states: { a: { on: { NEXT: "b", PREVIOUS: "hist" }, onEntry: "sayHello" }, b: { on: { NEXT: "c", PREVIOUS: "hist" }, onEntry: "sayCiao" }, c: { on: { NEXT: "a", PREVIOUS: "hist" }, onEntry: "sayHej" }, hist: { type:"history", history: "deep", target: initialState } } }; `
My test code