From eaaff460d1fdb18a70f068f0170a37e15030eecb Mon Sep 17 00:00:00 2001 From: Omer Naveh <89572395+OmerNaveh@users.noreply.github.com> Date: Mon, 19 Dec 2022 11:07:20 +0200 Subject: [PATCH] bug fix for destroy function This will fix unwanted bug for when component will unmount but a user has several animation and chose to not display an animation- i.e display:'none' --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index bbc4364..8a49f8f 100644 --- a/src/index.js +++ b/src/index.js @@ -94,6 +94,7 @@ export default class Lottie extends React.Component { } destroy() { +if(!this.anim) return; this.anim.destroy(); }