Switch component
This commit is contained in:
parent
5af7dc6cfa
commit
5bd158782a
@ -37,7 +37,7 @@ export function Switch(props: SwitchProps): JSX.Element {
|
||||
const [isChecked, setChecked] = createControllableSignal<boolean>({
|
||||
value: () => local.checked,
|
||||
defaultValue: () => local.defaultChecked ?? false,
|
||||
onChange: local.onCheckedChange ?? (() => {}),
|
||||
onChange: local.onCheckedChange,
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
@ -29,7 +29,7 @@ export function Toggle(props: ToggleProps): JSX.Element {
|
||||
const [isPressed, setPressed] = createControllableSignal<boolean>({
|
||||
value: () => local.pressed,
|
||||
defaultValue: () => local.defaultPressed ?? false,
|
||||
onChange: local.onPressedChange ?? (() => {}),
|
||||
onChange: local.onPressedChange,
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user