rlaffers / xstate-ninja

Devtool for XState state machines
ISC License
68 stars 3 forks source link

Does this work with React Native? #6

Closed ccapndave closed 1 year ago

ccapndave commented 1 year ago

Hi!

I just found this great looking tool and I'd love to use it with React Native. However, my attempts so far have failed with:

TypeError: Cannot read property 'useMachine' of undefined

Would we expect the library to work with React Native?

ccapndave commented 1 year ago

There is also a Property "CustomEvent" doesn't exist error in the stack.

rlaffers commented 1 year ago

Hi Dave, that's a good question. XState Ninja attempts to import useMachine from @xstate/react which is its peer dependency. Do you normally use @xstate/react in your React Native machine without issues?

CustomEvent is a standard browser API which apparently is not available in React Native, so I'm afraid @xstate-ninja/react will not work in RN.

ccapndave commented 1 year ago

The @xstate/react version of useMachine works as expected. But it sounds like its a no go anyway. Thanks very much!