diff options
author | kotontrion <[email protected]> | 2024-10-10 11:28:11 +0200 |
---|---|---|
committer | kotontrion <[email protected]> | 2024-10-10 11:28:11 +0200 |
commit | 08f10ce3968166c55f5f2e3009415e4899e9a73b (patch) | |
tree | c6f914debe8f86e8ec7275f86a4181b20cf5f45a /core/gjs/src/jsx/jsx-runtime.ts | |
parent | 10447f5abcb28f3df1544f1732f82d538130b3c9 (diff) | |
parent | 075c7e34aa0fbdc07c86965ab5a2ae79b92d3fd3 (diff) |
Merge branch 'main' into feat/cava
Diffstat (limited to 'core/gjs/src/jsx/jsx-runtime.ts')
-rw-r--r-- | core/gjs/src/jsx/jsx-runtime.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/gjs/src/jsx/jsx-runtime.ts b/core/gjs/src/jsx/jsx-runtime.ts index a0aafb6..f40dc05 100644 --- a/core/gjs/src/jsx/jsx-runtime.ts +++ b/core/gjs/src/jsx/jsx-runtime.ts @@ -16,14 +16,15 @@ export function jsx( children = children.filter(Boolean) - if (typeof ctor === "string") - return (ctors as any)[ctor](props, children) - if (children.length === 1) props.child = children[0] else if (children.length > 1) props.children = children + if (typeof ctor === "string") { + return new ctors[ctor](props) + } + if (isArrowFunction(ctor)) return ctor(props) @@ -63,7 +64,7 @@ declare global { box: Widget.BoxProps button: Widget.ButtonProps centerbox: Widget.CenterBoxProps - circularprogress: Widget.CircularProgressProps, + circularprogress: Widget.CircularProgressProps drawingarea: Widget.DrawingAreaProps entry: Widget.EntryProps eventbox: Widget.EventBoxProps |