useBoolean

致谢: Re-export from react-use

React 状态 Hook,用于跟踪布尔值。

useBooleanuseToggle 的别名。

示例

See useToggle for more details.

类型定义

declare function useBoolean(
  initialValue: boolean
): [boolean, (nextValue?: any) => void];