useToggleState
A hook to easily toggle a boolean type of state.
function useToggleState(defaultValue?: boolean): readonly [boolean, () => void];
Example
const [bool, toggle] = useToggleState(false);
A hook to easily toggle a boolean type of state.
function useToggleState(defaultValue?: boolean): readonly [boolean, () => void];
const [bool, toggle] = useToggleState(false);