tajo / react-movable

🔀 Drag and drop for your React lists and tables. Accessible. Tiny.
https://react-movable.pages.dev
MIT License
1.53k stars 51 forks source link

fix: memory leak, clearTimeout and cancelAnimationFrame on componentWillUnmount #77

Closed bryan-hunter closed 2 years ago

bryan-hunter commented 2 years ago

closes https://github.com/tajo/react-movable/issues/73

When the List component is removed (via a click/touch), requestAnimationFrame is executed but not finished, so results in a memory leak.

this PR returns a cancel function from the schd util so we can cancel it on unmount. Also added clearTimeout just in case

tajo commented 2 years ago

Nice catch. Thanks. I have to look into CI and will merge after.

tajo commented 2 years ago

@bryan-hunter Can you rebase master? It should fix the CI. Thanks

bryan-hunter commented 2 years ago

@bryan-hunter Can you rebase master? It should fix the CI. Thanks

Done 👍

mdrobny commented 2 years ago

Any estimates when it will be released?

tajo commented 2 years ago

published