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 provide useCallbackOne? #8

Closed
rimunroe opened this issue Aug 7, 2019 · 2 comments
Closed

Why provide useCallbackOne? #8

rimunroe opened this issue Aug 7, 2019 · 2 comments

Comments

@rimunroe
Copy link

rimunroe commented Aug 7, 2019

useMemoOne is really handy! Thanks for making it! I just have a few questions about useCallbackOne: The React hooks API docs quoted in the readme specifically explain that useMemo should not be relied on for semantic guarantee, but I don't see anything like that for useCallback. Do you have additional info regarding this?

Also, since useMemoOne is intended to be used to create arbitrary values which are stable across re-renders, why provide useCallbackOne at all?

@rimunroe rimunroe changed the title Why provide useCallback? Why provide useCallbackOne? Aug 7, 2019
@denis-sokolov
Copy link
Contributor

Indeed, useCallback has the same behavior as useMemo, see the React issue.

@rimunroe
Copy link
Author

rimunroe commented Sep 26, 2019

Ah! You're right. I'll go ahead and close this.

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