From f38ee840dc96b7bd8057803f7acf93a70d4c14ff Mon Sep 17 00:00:00 2001 From: Hernan Torrisi Date: Mon, 9 Dec 2024 11:33:14 -0800 Subject: [PATCH] delete renderer on cleanup --- src/hooks/useRive.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hooks/useRive.tsx b/src/hooks/useRive.tsx index 70f4af3..b431af0 100644 --- a/src/hooks/useRive.tsx +++ b/src/hooks/useRive.tsx @@ -141,6 +141,7 @@ export default function useRive( } else { // If unmounted, cleanup the rive object immediately r.cleanup(); + r.deleteRiveRenderer(); } }); } @@ -224,6 +225,7 @@ export default function useRive( return () => { if (rive) { rive.cleanup(); + rive.deleteRiveRenderer(); setRive(null); } };