Hex Core JS
    Preparing search index...

    Function useToggle

    • Provdes a boolean state variable with a toggle utility function.

      Parameters

      • initialValue: TypeOrFunction<boolean> = false

        The initial value or a function that returns the initial value of the isOn variable.

      Returns {
          isOn: boolean;
          setIsOn: Dispatch<SetStateAction<boolean>>;
          toggle: () => void;
          turnOff: () => void;
          turnOn: () => void;
      }