From 5a5a5755bc1f10add9c7a100ea6577ab6d427c0c Mon Sep 17 00:00:00 2001 From: xobotyi Date: Tue, 6 Apr 2021 11:38:36 +0300 Subject: [PATCH] fix: lint issues. --- src/useSetState.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/useSetState.ts b/src/useSetState.ts index abe962272a..47371d7a08 100644 --- a/src/useSetState.ts +++ b/src/useSetState.ts @@ -4,14 +4,11 @@ const useSetState = ( initialState: T = {} as T ): [T, (patch: Partial | ((prevState: T) => Partial)) => void] => { const [state, set] = useState(initialState); - const setState = useCallback( - (patch) => { - set((prevState) => - Object.assign({}, prevState, patch instanceof Function ? patch(prevState) : patch) - ); - }, - [] - ); + const setState = useCallback((patch) => { + set((prevState) => + Object.assign({}, prevState, patch instanceof Function ? patch(prevState) : patch) + ); + }, []); return [state, setState]; };