https://www.somethingsblog.com/2024/10/23/how-to-fix-infinite-loops-with-reacts-useeffect-hook/