@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 +5 -1
- package/package.json +1 -1
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
|
|
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