-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup function for react #41
Comments
This is a very annoying issue for developing in auto refreshing environments that only refresh the modified components. I don't understand your example though @abdoseadaa? Should there not be a function that cleans up the whole swapy object rather than just removing an event listener function? e.g. useEffect(() => {
...
return () => {
swapy.cleanup()
};
} Even without the use of swapy.onSwap, it still gets slow over time. |
removing listeners or removing all swapy instance anyone will do return () => {
// need to add this 👇
swapy.offSwap(handleSwap); // @important
}; in the above example i put this part to show the owner what a cleanup should look like |
@abdoseadaa Thank you for opening this issue. It's a critical one; I'll make sure to update it soon. I'll let you know :) |
@TahaSh thank you so much , Great work btw |
@abdoseadaa I've added |
Swapy@2.0.0.mp4it's now even faster than @dnd-kit/core , i am using swapy as main drag drop lib ربنا يبارك فيك 💕 |
issue resolved |
@abdoseadaa I'm really happy to hear that. Thank you! 🙏 |
clean up function for useEffect
this is my code version
should have
Gabster.And.5.More.Pages.-.Personal.2.comp.-.Microsoft.Edge.2024-08-28.06-18-02.mp4
The text was updated successfully, but these errors were encountered: