From 0d8bbe563a462969d8e0c731cb207222c6d19520 Mon Sep 17 00:00:00 2001 From: ModZero Date: Sun, 23 Aug 2020 05:24:20 +0200 Subject: [PATCH] Reuse the context --- src/components/Canvas.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Canvas.tsx b/src/components/Canvas.tsx index 0ba2ca4..e6b52c9 100644 --- a/src/components/Canvas.tsx +++ b/src/components/Canvas.tsx @@ -20,7 +20,7 @@ function SystemCanvas({ height, width, children }: SystemCanvasProps) { const context = canvasRef.current.getContext("2d") setContext(context) } - }, [frameCount]) + }, [canvasRef.current]) React.useEffect(() => { const frameId = requestAnimationFrame(() => {