I'm referring to useIsMounted from usehooks-ts. I'm trying to understand why the function is returning useCallback(() => isMounted.current, []) instead of just isMounted.current.
I've tested both ideas in a CodeSandbox that just uses a setTimeout to simulate async work and I haven't found any issues returning the value instead of a callback. What am I missing?