DEV Community

Discussion on: How to manage global state with XState and React

Collapse
 
rmjersey profile image
Richard Moore • Edited

For anyone having TypeScript issues with this in XState 4.29+ (where there are new schema and tsTypes attributes on the machine, see xstate.js.org/docs/guides/typescri...), ActorRefFrom no longer seems to work but you can use InterpreterFrom in its place

type GlobalStateContextType = {
    authService: InterpreterFrom<typeof authMachine>;
};
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mattpocockuk profile image
Matt Pocock

Looks like it's fixed now:

github.com/statelyai/xstate/commit...