Error: Calling setState synchronously within an effect can trigger cascading renders

And React 19’s useEffectEvent Is the Fix You Didn’t Know You Needed