react-alien-signals
    Preparing search index...

    Function useSetSignal

    • React hook that returns only a setter function for a writable signal. This is similar to Jotai's useSetAtom and can be helpful when you only need to update state.

      Type Parameters

      • T

        The type of the signal value.

      Parameters

      Returns SignalSetter<T>

      A setter function to update the signal.

      const count = createSignal(0);
      function IncrementButton() {
      const setCount = useSetSignal(count);
      return <button onClick={() => setCount((c) => c + 1)}>+1</button>;
      }