React hook returning [value, setValue] for a given Alien Signal. Uses useSyncExternalStore for concurrency-safe re-renders.
[value, setValue]
The type of the signal value.
The signal to read/write.
A tuple [currentValue, setValue].
const countSignal = createSignal(0);function Counter() { const [count, setCount] = useSignal(countSignal); return <button onClick={() => setCount(count + 1)}>{count}</button>;} Copy
const countSignal = createSignal(0);function Counter() { const [count, setCount] = useSignal(countSignal); return <button onClick={() => setCount(count + 1)}>{count}</button>;}
React hook returning
[value, setValue]
for a given Alien Signal. Uses useSyncExternalStore for concurrency-safe re-renders.