-
Notifications
You must be signed in to change notification settings - Fork 178
Closed
Description
Hey @TahaSh,
i recognised that the new onSwapEnd event sometimes get triggered twice.
You can simple add a console.log to the event and check your logs while swapping.
I have recorded it:
https://r2.fakecrime.bio/uploads/9d7ab895-ea0a-43e7-93c1-2693a300f87f.mp4
I am using next.js 14 with the app router and heres my useEffect, if it might help to reproduce
useEffect(() => {
const container = document.querySelector('.container')!;
const swapy = createSwapy(container, {
animation: 'dynamic',
continuousMode: true,
swapMode: 'drop'
});
swapy.onSwapEnd(({ data }) => {
console.log('test');
});
return () => {
swapy.destroy();
};
}, []);
I hope you can find the issue and fix it asap 😊
Thanks ❤️
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels