typescriptxstate

Is there a TypeScript way of getting a child from a state in xState?


At the moment I do it like this:

useActor<SomeInterpreter>((state as any).children.SomeChild);

Since I'm not a big fan of "any" in TypeScript, is there another way of doing this?


Solution

  • At the moment of this comment this is not possible, according to David Khourshid. they will add a better way in the future.