Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is useCallback not implemented? #239

Open
kentcb opened this issue Apr 6, 2023 · 3 comments
Open

Why is useCallback not implemented? #239

kentcb opened this issue Apr 6, 2023 · 3 comments

Comments

@kentcb
Copy link

kentcb commented Apr 6, 2023

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
Copy link
Author

kentcb commented Apr 6, 2023

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
Copy link
Member

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
Copy link
Member

Sorry, closed this by mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants