Skip to content

Commit

Permalink
delete renderer on cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymovin committed Dec 9, 2024
1 parent 1f6ae83 commit f38ee84
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hooks/useRive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export default function useRive(
} else {
// If unmounted, cleanup the rive object immediately
r.cleanup();
r.deleteRiveRenderer();
}
});
}
Expand Down Expand Up @@ -224,6 +225,7 @@ export default function useRive(
return () => {
if (rive) {
rive.cleanup();
rive.deleteRiveRenderer();
setRive(null);
}
};
Expand Down

0 comments on commit f38ee84

Please sign in to comment.