rework <slot/>

This commit is contained in:
CoolElectronics 2024-01-30 10:45:39 -05:00
parent b424342d64
commit 3cd8372c08
No known key found for this signature in database
GPG key ID: F63593D168636C50
3 changed files with 4 additions and 5 deletions

6
js.js
View file

@ -165,12 +165,12 @@ export function h(type, props, ...children) {
}
Object.assign(newthis, props);
let slot = [];
newthis.children = [];
for (const child of children) {
JSXAddChild(child, slot.push.bind(slot));
JSXAddChild(child, newthis.children.push.bind(slot));
}
let elm = type.apply(newthis, [slot]);
let elm = type.apply(newthis);
elm.$ = newthis;
newthis.root = elm;
if (newthis.css) {