@@ -20,6 +20,7 @@ export function TestUi1Component() {
|
|||||||
Component.useSignal(buttonRef, "pressed", () => {
|
Component.useSignal(buttonRef, "pressed", () => {
|
||||||
console.log("Pressed!")
|
console.log("Pressed!")
|
||||||
})
|
})
|
||||||
|
const [buttonPressed] = Component.useSignalValues(buttonRef, "toggled", () => [false] as const)
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -28,7 +29,7 @@ export function TestUi1Component() {
|
|||||||
>
|
>
|
||||||
<Label
|
<Label
|
||||||
name="Label"
|
name="Label"
|
||||||
text="This is a label"
|
text={buttonPressed ? "The button is pressed" : "The button is not pressed"}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextEdit
|
<TextEdit
|
||||||
@@ -41,6 +42,7 @@ export function TestUi1Component() {
|
|||||||
<Button
|
<Button
|
||||||
ref={buttonRef}
|
ref={buttonRef}
|
||||||
name="Button"
|
name="Button"
|
||||||
|
toggle_mode
|
||||||
text="Ok"
|
text="Ok"
|
||||||
/>
|
/>
|
||||||
</VFlowContainer>
|
</VFlowContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user