@koordinates/xstate-tree 5.5.0 → 5.5.1

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
@@ -112,7 +112,11 @@ function useSlots(interpreter, slots) {
112
112
  return react_2.default.createElement(MultiView, null);
113
113
  }
114
114
  else {
115
- const interpreterForSlot = children[`${slot.toLowerCase()}-slot`];
115
+ const slotPrefix = `${slot.toLowerCase()}-`;
116
+ const childKey = Object.keys(children).find((key) => key.startsWith(slotPrefix) && key.endsWith("-slot"));
117
+ const interpreterForSlot = childKey
118
+ ? children[childKey]
119
+ : undefined;
116
120
  if (interpreterForSlot) {
117
121
  const View = getViewForInterpreter(interpreterForSlot);
118
122
  return react_2.default.createElement(View, null, reactChildren);
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": "5.5.0",
5
+ "version": "5.5.1",
6
6
  "license": "MIT",
7
7
  "description": "Build UIs with Actors using xstate and React",
8
8
  "keywords": [