what purpose does useLiveSignal and useSignalRef have?
#689
Answered
by
JoviDeCroock
rawrmonstar
asked this question in
Q&A
|
I saw the new signal utils and they are very cool, I am just having trouble understanding what Is |
Answered by
JoviDeCroock
May 29, 2025
Replies: 1 comment
|
With const ResizeObserver = () => {
ref = signalRef()
effect(() => {
// If ref changes recreate the observer
})
return props.condition ? <div ref={ref} /> : <span ref={ref} />
}
|
0 replies
Answer selected by
rawrmonstar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With
useSignalRefyou can react to therefchanging, so let's say you have the following componentuseLiveSignalis used when the identity of the signal passed to the component can change, as seen in #361 (comment)