@koordinates/xstate-tree 4.11.0 → 4.11.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 +7 -1
- package/package.json +1 -1
package/lib/xstateTree.js
CHANGED
|
@@ -113,7 +113,13 @@ function useSlots(interpreter, slots) {
|
|
|
113
113
|
return react_2.default.createElement(MultiView, null);
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
const
|
|
116
|
+
const slotPrefix = `${slot.toLowerCase()}-`;
|
|
117
|
+
const childKey = [...children.keys()].find((key) => typeof key === "string" &&
|
|
118
|
+
key.startsWith(slotPrefix) &&
|
|
119
|
+
key.endsWith("-slot"));
|
|
120
|
+
const interpreterForSlot = childKey
|
|
121
|
+
? children.get(childKey)
|
|
122
|
+
: undefined;
|
|
117
123
|
if (interpreterForSlot) {
|
|
118
124
|
const View = getViewForInterpreter(interpreterForSlot);
|
|
119
125
|
return react_2.default.createElement(View, null);
|
package/package.json
CHANGED