UNPKG
common-hook
Version:
latest (1.3.2)
1.3.2
1.2.0
1.1.0
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.0.3
0.0.2
0.0.1
提供项目中常用的 React Hooks
github.com/JainaXiong/common-hook
JainaXiong/common-hook
common-hook
/
es
/
state
/
useToggle.d.ts
8 lines
(7 loc)
•
291 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
/** *
@name
用于在两个状态值间切换Hook *
@description
默认为 boolean 切换,基础用法与 useBoolean 一致 *
@example
* const [state, { toggle, setLeft, setRight }] = useToggle() */
export
declare
const
useToggle
: <D, R>
(
defaultValue
?: D,
reverseValue
?: R
) =>
any
[];