diff --git a/src/components/atoms/canvas.tsx b/src/components/atoms/canvas.tsx index e9ca1c80..cbef98c2 100644 --- a/src/components/atoms/canvas.tsx +++ b/src/components/atoms/canvas.tsx @@ -27,8 +27,9 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { const canvasRef = useRef(null); const { socket } = useSocketStore(); const { setLastAction, lastAction } = useGlobalInfoStore(); - const { getText } = useActionContext(); + const { getText, getList } = useActionContext(); const getTextRef = useRef(getText); + const getListRef = useRef(getList); const notifyLastAction = (action: string) => { if (lastAction !== action) { @@ -40,7 +41,8 @@ const Canvas = ({ width, height, onCreateRef }: CanvasProps) => { useEffect(() => { getTextRef.current = getText; - }, [getText]); + getListRef.current = getList; + }, [getText, getList]); const onMouseEvent = useCallback((event: MouseEvent) => { if (socket) {