Skip to content
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

Request: calling to stop animation #130

Open
ListeH opened this issue Nov 26, 2020 · 1 comment
Open

Request: calling to stop animation #130

ListeH opened this issue Nov 26, 2020 · 1 comment

Comments

@ListeH
Copy link

ListeH commented Nov 26, 2020

Hi, first of all, great package. But I have little problem, when I am redirecting my page to another subpage, there is memory leak. I need in useEffect cleanup function stop animation, but there is no option to stop it, something like, sprite.stop(),.. and this indicate memory leaks in that case.

@jcblw
Copy link
Owner

jcblw commented Nov 26, 2020

Hi, @ListeH thanks for taking the time to open the issue. I would love to get to the bottom of this. What are you seeing that indicates the animation is still running? Are there timers still being set? I see that we cancel the requestAnimationFrame on the cleanup of the use effect sounds like that is not enough.

https://github.com/jcblw/react-sprite-animator/blob/master/src/useSprite.js#L138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants