UNPKG
@wojtekmaj/react-hooks
Version:
latest (2.0.4)
2.0.4
2.0.2
2.0.1
2.0.0
1.22.0
1.21.0
1.20.0
1.19.0
1.18.1
1.18.0
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.1
1.15.0
1.14.1
1.14.0
1.13.0
1.12.0
1.11.1
1.11.0
1.10.1
1.10.0
1.9.0
1.8.0
1.7.0
1.6.0
1.5.0
1.4.0
1.3.0
1.2.0
1.1.0
1.0.0
A collection of React Hooks.
wojtekmaj/react-hooks
@wojtekmaj/react-hooks
/
dist
/
useToggle.d.ts
8 lines
(7 loc)
•
248 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
/** * Returns a flag and a function to toggle it. * *
@param
{
boolean
} defaultValue Default value *
@returns
{
[boolean, () => void]
} Flag and toggle function */
export
default
function
useToggle
(
defaultValue
?:
boolean
): [
boolean
,
() =>
void
];