UNPKG
react-use-state-with-callback
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
use state with callback in hooks
y805939188/personal-common-tool-and-components
react-use-state-with-callback
/
lib
/
index.d.ts
4 lines
(3 loc)
•
212 B
TypeScript
View Raw
1
2
3
4
declare
type
CallbackType
= <S>
(
prevState
: S,
currentState
: S
) =>
void
;
declare
const
useStateWithCallback
: <T>
(
initState
: T
) =>
[T,
(
newState
: T,
b
?:
CallbackType
) =>
void
];
export
default
useStateWithCallback;