DEV Community

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

Collapse
 
paulrberg profile image
Paul Razvan Berg

The snippet that shows how to use useActor may be outdated:

TypeError: Cannot use 'in' operator to search for 'getSnapshot' in undefined

This is with react@17.0.2, xstate@4.23.0 and @xstate/react@npm:1.5.1.

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
paulrberg profile image
Paul Razvan Berg

The issue is that you're not consuming the context provider.

github.com/statelyai/xstate/issues...