diff --git a/src/useGetSetState.ts b/src/useGetSetState.ts index 0e0e9962d9..1eba660abf 100644 --- a/src/useGetSetState.ts +++ b/src/useGetSetState.ts @@ -4,7 +4,7 @@ import useUpdate from './useUpdate'; const useGetSetState = (initialState: T = {} as T): [() => T, (patch: Partial) => void]=> { if (process.env.NODE_ENV !== 'production') { if (typeof initialState !== 'object') { - throw new TypeError('useGetSetState initial state must be an object.'); + console.error('useGetSetState initial state must be an object.'); } } @@ -15,7 +15,7 @@ const useGetSetState = (initialState: T = {} as T): [() => T, if (!patch) return; if (process.env.NODE_ENV !== 'production') { if (typeof patch !== 'object') { - throw new TypeError('useGetSetState setter patch must be an object.'); + console.error('useGetSetState setter patch must be an object.'); } } Object.assign(state.current, patch); diff --git a/src/useHoverDirty.ts b/src/useHoverDirty.ts index e99c08753f..42e867497c 100644 --- a/src/useHoverDirty.ts +++ b/src/useHoverDirty.ts @@ -4,7 +4,7 @@ import {useEffect, useState} from 'react'; const useHoverDirty = (ref, enabled: boolean = true) => { if (process.env.NODE_ENV === 'development') { if ((typeof ref !== 'object') || (typeof ref.current === 'undefined')) { - throw new TypeError('useHoverDirty expects a single ref argument.'); + console.error('useHoverDirty expects a single ref argument.'); } } diff --git a/src/useMouse.ts b/src/useMouse.ts index 66709a16d3..7e9d948d2e 100644 --- a/src/useMouse.ts +++ b/src/useMouse.ts @@ -15,7 +15,7 @@ export interface State { const useMouse = (ref: RefObject, whenHovered: boolean = false): State => { if (process.env.NODE_ENV === 'development') { if ((typeof ref !== 'object') || (typeof ref.current === 'undefined')) { - throw new TypeError('useMouse expects a single ref argument.'); + console.error('useMouse expects a single ref argument.'); } }