UNPKG

react-use-state-with-callback

Version:

use state with callback in hooks

4 lines (3 loc) 212 B
declare type CallbackType = <S>(prevState: S, currentState: S) => void; declare const useStateWithCallback: <T>(initState: T) => [T, (newState: T, b?: CallbackType) => void]; export default useStateWithCallback;