I can't upgrade above beta-41 in our react-native code base (which uses actor model with spawn). I have tried digging into the problem, but I keep getting the error
TypeError: Cannot read property 'value' of undefined
somewhere inside the matches function in XState, that I use via:
export const MainActor = createActorContext(mainMachine);
// ...
const inSomeState = MainActor.useSelector(({ matches }) => matches('SomeState'));
If I upgrade to beta-42 or above our whole code base will crash with this error in runtime the first time any matches function is used like above.
What I find is that in XState function machineSnapshotMatches, this is undefined and therefore this.value crashes. It is hard to see in the distributed XState code (raise-746abff7.cjs.js) how this can ever be defined there.
Anyhow, that function uses matchesState, which is exported from XState. So my workaround is to replace all uses of matches with machesState.
I understand that it's hard to say much with the above info, it doesn't seem anyone else has run into this problem. But any ideas at all?