|
1 | | -import { h, cloneElement, render, hydrate, Fragment } from 'preact'; |
| 1 | +import { h, cloneElement, render, hydrate } from 'preact'; |
2 | 2 |
|
3 | 3 | /** |
4 | 4 | * @typedef {import('./internal.d.ts').PreactCustomElement} PreactCustomElement |
@@ -177,8 +177,7 @@ function Slot(props, context) { |
177 | 177 | } |
178 | 178 | } |
179 | 179 | }; |
180 | | - const { useFragment, ...rest } = props; |
181 | | - return h(useFragment ? Fragment : 'slot', { ...rest, ref }); |
| 180 | + return h('slot', { ...props, ref }); |
182 | 181 | } |
183 | 182 |
|
184 | 183 | function toVdom(element, nodeName, options) { |
@@ -210,9 +209,8 @@ function toVdom(element, nodeName, options) { |
210 | 209 | const shadow = !!(options && options.shadow); |
211 | 210 |
|
212 | 211 | // Only wrap the topmost node with a slot |
213 | | - const wrappedChildren = nodeName |
214 | | - ? h(Slot, { useFragment: !shadow }, children) |
215 | | - : children; |
| 212 | + const wrappedChildren = |
| 213 | + nodeName && shadow ? h(Slot, null, children) : children; |
216 | 214 |
|
217 | 215 | if (!shadow && nodeName) { |
218 | 216 | element.innerHTML = ''; |
|
0 commit comments