• Toggle hook which accepts initial state and returns the toggle state and controls.


    Parameters

    • Optional initialState: boolean

    Returns UseToggleReturnType

    Toggle value and controls

    Example

    const { state, disable, enable, set, toggle } = useToggle(initalState);