@react-hookz/web
Version:
React hooks done right, for browser and SSR.
10 lines (9 loc) • 425 B
TypeScript
import { IInitialState, INextState } from '../util/resolveHookState';
/**
* Like `useSafeState`, but can only become `true` or `false`.
*
* State setter, in case called without arguments, will change the state to opposite.
*
* @param initialState Initial toggle state, defaults to false.
*/
export declare function useToggle(initialState?: IInitialState<boolean>): [boolean, (nextState?: INextState<boolean>) => void];