diff --git a/src/useToggle.ts b/src/useToggle.ts index 0707dfd255..77f3523e8d 100644 --- a/src/useToggle.ts +++ b/src/useToggle.ts @@ -9,8 +9,8 @@ const useToggle: UseToggle = state => { const [value, setValue] = useState(state); const toggle = (nextValue?: boolean) => { - if (typeof nextValue === 'boolean') { - setValue(nextValue); + if (typeof nextValue !== 'undefined') { + setValue(!!nextValue); return; }