diff options
| author | Adam <[email protected]> | 2025-12-19 15:11:42 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-20 04:25:17 -0600 |
| commit | 26cf5e003ebd402b3343504dd6726a4c8cc9ffe3 (patch) | |
| tree | 39553711b6f21da32918272181416515575ad987 /packages/ui/src/components/switch.tsx | |
| parent | 742cf10deeffb31292cdbf8a5ca7afb07698d9dc (diff) | |
| download | opencode-26cf5e003ebd402b3343504dd6726a4c8cc9ffe3.tar.gz opencode-26cf5e003ebd402b3343504dd6726a4c8cc9ffe3.zip | |
fix(desktop): perf stuff
Diffstat (limited to 'packages/ui/src/components/switch.tsx')
| -rw-r--r-- | packages/ui/src/components/switch.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/ui/src/components/switch.tsx b/packages/ui/src/components/switch.tsx index af70dfb5c..a8600aef4 100644 --- a/packages/ui/src/components/switch.tsx +++ b/packages/ui/src/components/switch.tsx @@ -1,5 +1,5 @@ import { Switch as Kobalte } from "@kobalte/core/switch" -import { children, Show, splitProps } from "solid-js" +import { Show, splitProps } from "solid-js" import type { ComponentProps, ParentProps } from "solid-js" export interface SwitchProps extends ParentProps<ComponentProps<typeof Kobalte>> { @@ -9,13 +9,12 @@ export interface SwitchProps extends ParentProps<ComponentProps<typeof Kobalte>> export function Switch(props: SwitchProps) { const [local, others] = splitProps(props, ["children", "class", "hideLabel", "description"]) - const resolved = children(() => local.children) return ( <Kobalte {...others} data-component="switch"> <Kobalte.Input data-slot="switch-input" /> - <Show when={resolved()}> + <Show when={local.children}> <Kobalte.Label data-slot="switch-label" classList={{ "sr-only": local.hideLabel }}> - {resolved()} + {local.children} </Kobalte.Label> </Show> <Show when={local.description}> |
