From 488d615799d13cb2da769a5a72827e71f103455d Mon Sep 17 00:00:00 2001 From: PrettyCoffee <66521452+PrettyCoffee@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:35:20 +0200 Subject: [PATCH] Update auto-height example to disconnect ResizeObserver when unmounted (#146) --- docs/auto-height.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/auto-height.tsx b/docs/auto-height.tsx index f3ed554..928526e 100644 --- a/docs/auto-height.tsx +++ b/docs/auto-height.tsx @@ -11,6 +11,8 @@ const AutoHeight = ({ children, ...props }) => { }); resizeObserver.observe(contentDiv.current); + + return () => resizeObserver.disconnect() }, []); return (