From e50b81cb4fc4e89d068af2fc6ad301ea3e8015a1 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Sun, 12 Jun 2022 15:49:07 +0800 Subject: [PATCH] client: fix jserror --- packages/client/src/components/resizeable/resizeable.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/resizeable/resizeable.tsx b/packages/client/src/components/resizeable/resizeable.tsx index 9e8e8471..d7a959de 100644 --- a/packages/client/src/components/resizeable/resizeable.tsx +++ b/packages/client/src/components/resizeable/resizeable.tsx @@ -57,12 +57,12 @@ export const Resizeable: React.FC = ({ const $bottomRight = useRef(null); useClickOutside($container, { - in: () => $container.current.classList.add(styles.isActive), - out: () => $container.current.classList.remove(styles.isActive), + in: () => $container.current && $container.current.classList.add(styles.isActive), + out: () => $container.current && $container.current.classList.remove(styles.isActive), }); useEffect(() => { - if (!isEditable) return; + if (!isEditable || !$container.current) return; interact($container.current).resizable({ edges: {