From 35407c346848c5371994106c2a86af250eeab245 Mon Sep 17 00:00:00 2001 From: Phoomparin Mano Date: Sun, 17 Dec 2023 17:18:53 +0700 Subject: [PATCH] fix: cleanup ESLint errors --- canvas/src/canvas/components/SlashCommand.tsx | 6 +++--- canvas/src/persist/hooks/useSaveState.ts | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/canvas/src/canvas/components/SlashCommand.tsx b/canvas/src/canvas/components/SlashCommand.tsx index ba053d24..e3cbf382 100644 --- a/canvas/src/canvas/components/SlashCommand.tsx +++ b/canvas/src/canvas/components/SlashCommand.tsx @@ -41,12 +41,12 @@ export function SlashCommand() { const destroy = useCallback(() => { window.removeEventListener("mousemove", onMouseMove) listening.current = false - }, []) + }, [onMouseMove]) const register = useCallback(() => { window.addEventListener("mousemove", onMouseMove) listening.current = true - }, []) + }, [onMouseMove]) useEffect(() => { if (listening.current) return @@ -56,7 +56,7 @@ export function SlashCommand() { return () => { destroy() } - }, [active]) + }, [active, destroy, register]) const command = useMemo(() => matches[selected], [matches, selected]) const argsValid = useMemo(() => isArgsValid(input, command), [input, command]) diff --git a/canvas/src/persist/hooks/useSaveState.ts b/canvas/src/persist/hooks/useSaveState.ts index a36931ca..d940f79e 100644 --- a/canvas/src/persist/hooks/useSaveState.ts +++ b/canvas/src/persist/hooks/useSaveState.ts @@ -1,5 +1,4 @@ import { BlockData } from "machine-wasm" -import { useMemo } from "react" import { useReactFlow } from "reactflow" import { defaultProps } from "@/blocks" @@ -102,5 +101,5 @@ export function useSaveState(): SaveStateContext { engine.ctx?.clear() } - return useMemo(() => ({ serialize, restore, clear }), []) + return { serialize, restore, clear } }