littensy / slither

🐍 A casual game with a soothing Catppuccin color palette
https://www.roblox.com/games/14162747150
MIT License
119 stars 9 forks source link

fix: do not start motion in `useMemo` #200

Closed littensy closed 10 months ago

littensy commented 10 months ago

Fixes a memory leak caused by React Strict Mode running useMemo twice on render, which is not ideal for operations with side effects (like connecting to Heartbeat). Updating the Motion has been moved to a manual Heartbeat connection instead of implicitly starting in useMemo.

Upgraded dependencies and applied ESLint and Prettier fixes.