Post
The compiler won't wrap an inline function here in useCallback for you because it changes semantics. /cc @gsathya.bsky.social
I'm referring to this discussion: bsky.app/profile/gsat...
Also I just realized a potential bug in the compiler after reading your post! The compiler will automatically move pure functions outside the component, which can break callback ref identity check
youtu.be/7yw_D3h4xSo?... If this video is true, I hope we stop using this term.
The video seems hung up on the wrong thing: many blog posts describe the problem with an incorrect analogy. Yet, "stale closure" is an apt description if you ignore the bad long-text blog description. Better would be "closure over a stale variable", but that would be unneccessarily long I guess.
0 reposts2 likes
Or, how @danabra.mov describes it: "a ghost of a function call": whatthefuck.is/closure#a-gh...