Did I just build a better useCallback?

from blog Vladimir Klepov as a Coder, | ↗ original
Edit: the technique initially proposed in this post was not concurrent-mode safe. I've added a new section describing a fix to this problem. Thanks to the readers who noticed it! useCallback has always been one of my least favorite hooks: it does not provide much value over useMemo (as we learnt in my previous post on hooks), it weirdly treats...