fable-compiler / fable-react

Fable bindings and helpers for React and React Native
MIT License
275 stars 66 forks source link

Why is useCallback not implemented? #239

Open kentcb opened 1 year ago

kentcb commented 1 year ago

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 commented 1 year ago

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.

alfonsogarciacaro commented 1 year ago

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 commented 1 year ago

Sorry, closed this by mistake.