@koordinates/xstate-tree 4.3.0-beta.4 → 4.3.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/xstateTree.js CHANGED
@@ -152,7 +152,7 @@ function XstateTreeView({ interpreter }) {
152
152
  // This is needed because the inState function needs to be recreated if the
153
153
  // current state the machine is in changes. But _only_ then
154
154
  // eslint-disable-next-line react-hooks/exhaustive-deps
155
- [current.value]);
155
+ [current === null || current === void 0 ? void 0 : current.value]);
156
156
  const selectorsProxy = (0, useConstant_1.useConstant)(() => {
157
157
  return new Proxy({}, {
158
158
  get: (_target, prop) => {
@@ -206,9 +206,10 @@ exports.XstateTreeView = XstateTreeView;
206
206
  * @internal
207
207
  */
208
208
  function recursivelySend(service, event) {
209
+ var _a;
209
210
  const children = ([...service.children.values()] || []).filter((s) => s.id.includes("-slot"));
210
211
  // If the service can't handle the event, don't send it
211
- if (service.state.nextEvents.includes(event.type)) {
212
+ if ((_a = service.getSnapshot()) === null || _a === void 0 ? void 0 : _a.nextEvents.includes(event.type)) {
212
213
  try {
213
214
  service.send(event);
214
215
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@koordinates/xstate-tree",
3
3
  "main": "lib/index.js",
4
4
  "types": "lib/xstate-tree.d.ts",
5
- "version": "4.3.0-beta.4",
5
+ "version": "4.3.0-beta.5",
6
6
  "license": "MIT",
7
7
  "description": "Build UIs with Actors using xstate and React",
8
8
  "keywords": [