Creates a new signal with the initial value undefined.
The initial value will only be applied on the very first call to this hook.
The same signal instance will be returned when this hook is called on the next render.
This is very similar (in concept) to React's builtin useState hook.
functionYourComponent() { constmySignal = useReactive(); constsomeEventHandler = () => { // Update the value after some event mySignal.value = "new value"; };
// Always returns the current value, re-renders if necessary. constcurrentValue = useReactiveValue(mySignal); }
Creates a new signal with the initial value
undefined.The initial value will only be applied on the very first call to this hook. The same signal instance will be returned when this hook is called on the next render. This is very similar (in concept) to React's builtin
useStatehook.