ShizukuIchi / winXP

🏁 Web based Windows XP desktop recreation.
https://winxp.now.sh
MIT License
5.51k stars 388 forks source link

Fixed an infinite loop when selecting desktop icons #97

Open m417z opened 3 years ago

m417z commented 3 years ago

The problem was that a new onIconsSelected function was created on each render, causing the following infinite loop:

To fix this, I wrapped setSelectedIcons with useCallback. And while at it, I wrapped all other functions.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shizukuichi/winXP/AwLsNmPBA6QutX2DU9Uxf3jguHPk
✅ Preview: https://winxp-git-fork-m417z-patch-2-shizukuichi.vercel.app