Skip to content

Add useSwitcher hook #2671

@Ruslan-web955

Description

@Ruslan-web955

Add a hook that would simplify working with boolean values

/**
 * @param defaultValue	initial value of the switch. Default {@link false}
 * @example
 *  const [isOpen, turnIsOpenOn, turnIsOpenOff, toggleIsOpen] = useSwitcher();
 */
export declare const useSwitcher: (defaultValue?: boolean) => readonly [boolean, () => void, () => void, () => void];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions