Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 466 Bytes

index.md

File metadata and controls

29 lines (22 loc) · 466 Bytes

useBoolean

管理 boolean 状态的 Hook。

Usage

import { useBoolean } from 'v3-use'
const [state, { toggle, setFalse, setTrue }] = useBoolean()

Reference

const [state, actions] = useBoolean(defaultValue?: boolean)

Type Declarations

export interface Actions {
  toggle: () => void
  setTrue: () => void
  setFalse: () => void
}
export declare function useBoolean(
  defaultValue?: boolean
): [Ref<boolean>, Actions]