diff --git a/src/index.ts b/src/index.ts index 772b21f..e6d1cb2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -905,9 +905,11 @@ export default function autoAnimate( ...(config as Partial), }) } - const mo = new MutationObserver(handleMutations) - mo.observe(el, { childList: true }) - mutationObservers.set(el, mo) + if (!mutationObservers.has(el)) { + const mo = new MutationObserver(handleMutations) + mo.observe(el, { childList: true }) + mutationObservers.set(el, mo) + } parents.add(el) } }