fable-react icon indicating copy to clipboard operation
fable-react copied to clipboard

Why is useCallback not implemented?

Open kentcb opened this issue 2 years ago • 3 comments

Hi,

I had a use case that seemingly could benefit from useCallback, although in this particular case I think I can get away with useRef (because I have no dependencies). All the same, it led me to find that useCallback has been commented out (and probably needs to be generic) and I wondered why that is?

Thanks

kentcb avatar Apr 06 '23 05:04 kentcb

Is it perhaps because a useMemo that returns a function is basically equivalent? That's what I ended up landing on. If that's the case, it makes me wonder why React has both useMemo and useCallback.

kentcb avatar Apr 06 '23 05:04 kentcb

TBH, I don't remember exactly. Maybe it was because we wanted to change the signature to a generic but had an issue with Fable currying/uncurrying and we didn't solve it at the end. Feliz does have a binding but only accepts 1-arity functions.

alfonsogarciacaro avatar Apr 06 '23 15:04 alfonsogarciacaro

Sorry, closed this by mistake.

alfonsogarciacaro avatar Apr 07 '23 00:04 alfonsogarciacaro