From 186580cccb2a06c618ecddb7d5fbda08b8d517b9 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Thu, 30 May 2024 23:53:24 +0200 Subject: [PATCH] feat(kitty): provide id in context --- src/components/Kitty.tsx | 6 +++--- src/context/KittyContext.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Kitty.tsx b/src/components/Kitty.tsx index 7b861e5..705f28a 100644 --- a/src/components/Kitty.tsx +++ b/src/components/Kitty.tsx @@ -52,8 +52,8 @@ export const Kitty = (props: { setWidth(`${width}px`); setHeight(`${height}px`); - setContext((ctx) => ({ ...(ctx ?? { active: false }), rows, cols })); - }, []); + setContext({ id, rows, cols }); + }, [id]); useEffect(() => { if (!container.current) return; @@ -71,7 +71,7 @@ export const Kitty = (props: {
( export type KittyContextProps = { rows: number; cols: number; - active: boolean; + id: string; };